UPDATE B SET B.loginname=c.loginname FROM t_employee A, t_systemuser B, oa_employee c WHERE A ...
場景 有兩個表部門表和人員表,人員表中的部門名稱與部門表中的部門名稱對應, 需要根據其對應關系在人員表中插入部門的id。 注: 博客: https: blog.csdn.net badao liumang qizhi 關注公眾號 霸道的程序猿 獲取編程相關電子書 教程推送與免費下載。 實現 其中sys user是人員表,sys group是部門表。 注意后面用了別名c 前面update后要緊跟着別 ...
2020-08-03 13:53 0 2658 推薦指數:
UPDATE B SET B.loginname=c.loginname FROM t_employee A, t_systemuser B, oa_employee c WHERE A ...
update 更新表 set 字段 = (select 參考數據 from 參考表 where 參考表.id = 更新表.id); update table_2 m set m.column = (select column from table_1 mp where mp.id ...
update 更新表 set 字段 = (select 參考數據 from 參考表 where 參考表.id = 更新表.id); update table_2 m set m.column = (select column from table_1 mp where mp.id= m.id ...
方法一: update 更新表 set 字段 = (select 參考數據 from 參考表 where 參考表.id = 更新表.id); 方法二: ...
生成sql語句 ...
update 更新表 set 字段 = (select 參考數據 from 參考表 where 參考表.id = 更新表.id); update table_2 m set m.column = (select column from table_1 mp where mp.id= m.id ...
方法一: update 更新表 set 字段 = (select 參考數據 from 參考表 where 參考表.id = 更新表.id); update table_2 m set m.column = (select column from table_1 mp where ...
SQL Server中,1. 目標表不存在 select * into 目標表 from 原表; 2. 目標表存在,只復制數據 insert into 目標表 select * from 原表; Oracle中, 1.目標表不存在 create ...