當前位置:首頁 » 編程語言 » 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上加個觸發器

熱點內容
安卓系統微信登錄設備管理在哪裡 發布:2025-03-16 07:44:55 瀏覽:504
青少兒編程品牌 發布:2025-03-16 07:43:24 瀏覽:627
江西電商存儲設備怎麼樣 發布:2025-03-16 07:32:10 瀏覽:303
中信電話密碼是多少 發布:2025-03-16 07:32:08 瀏覽:366
怎麼樣學好編程 發布:2025-03-16 07:31:24 瀏覽:569
python輸出素數 發布:2025-03-16 07:31:21 瀏覽:418
顯卡加速編譯 發布:2025-03-16 07:28:53 瀏覽:683
javadebug 發布:2025-03-16 07:16:21 瀏覽:284
怎麼搭建linux伺服器ftp 發布:2025-03-16 07:07:38 瀏覽:989
晶元存儲原理 發布:2025-03-16 06:58:21 瀏覽:284