當前位置:首頁 » 編程語言 » sql對比兩個表

sql對比兩個表

發布時間: 2023-08-27 10:24:08

⑴ SQL如何對比兩張表的數據

insert
into
tablea
select
*
from
tablea
where
not
exists
(selelct
'1'
from
tableb
where
tablea.serverid
=
serverid
and
tablea.driverid
=
driverid
and
tablea.driversize
=
driversize)
update
tablea
set
tablea.driversize
=
tablea.driversize
from
tablea
,tableb
where
tablea.serverid
=
serverid
and
tablea.driverid
=
driverid
如果你以tableb為準的話,你最好在tableb上加個觸發器

熱點內容
fortran如何編譯 發布:2025-07-13 22:31:05 瀏覽:480
sql語句查詢欄位 發布:2025-07-13 22:24:20 瀏覽:632
python目錄遍歷 發布:2025-07-13 22:16:24 瀏覽:96
賣房說解壓 發布:2025-07-13 22:06:49 瀏覽:216
C加密傳輸 發布:2025-07-13 22:06:08 瀏覽:162
配置不合理怎麼解決 發布:2025-07-13 22:01:07 瀏覽:735
linux毫秒 發布:2025-07-13 21:56:09 瀏覽:830
編譯器安全測試 發布:2025-07-13 21:54:29 瀏覽:39
python打開應用程序 發布:2025-07-13 21:46:09 瀏覽:523
怎麼配置電視機 發布:2025-07-13 21:34:24 瀏覽:975