查询A表数据插入到B表中

---插入语句
INSERT INTO DT_CK_CZRY_MX 
           select t.czy_dm ,t.czy_mc ,'','','','','','','','','','','','','2370193000005','行政服务大厅',''
  from DT_CK_CZRY t
 where t.dt_dm = '2370193000005'
   and t.czy_dm not in (select t.czy_dm from dt_ck_czry_mx t where t.dt_dm = '2370193000005')

猜你喜欢

转载自blog.csdn.net/tianya9006/article/details/74388898