SQL Server 從一個表查詢數據插入到另外一個表中


 從一個表查詢數據插入到另外一個表中

 

-- 插入數據
insert into a_linshibiao (xh,termcode,kcbh)
select cc.xh,cc.termcode,cc.kcbh
from py_cj cc left join xj on cc.xh=xj.xh
   where (cc.termcode=36 or cc.termcode=37)
    and (xj.nj =2019)
    and (cc.xwbj=0 or isnull(cc.xwbj,'')=0)


 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM