1. 程式人生 > >數據庫修改一個表中的字段值等於另一個表字段值

數據庫修改一個表中的字段值等於另一個表字段值

name update client bsp select class 代碼 alc body

(MS SQL Server)語句:
Sql代碼
update b set ClientName = a.name from a,b where a.id = b.id
(Oralce)語句:
Sql代碼
update b set (ClientName) = (SELECT name FROM a WHERE b.id = a.id)

數據庫修改一個表中的字段值等於另一個表字段值