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

熱點內容
php集成支付寶 發布:2025-09-16 14:05:28 瀏覽:715
php的pregmatchall 發布:2025-09-16 14:04:43 瀏覽:434
片上緩存區 發布:2025-09-16 13:49:18 瀏覽:152
查驗技巧腳本 發布:2025-09-16 13:41:59 瀏覽:726
安卓如何讓應用隱藏 發布:2025-09-16 13:28:58 瀏覽:340
連接ftp異常中斷 發布:2025-09-16 12:52:33 瀏覽:289
3m移動辦公伺服器地址大全 發布:2025-09-16 12:22:35 瀏覽:257
什麼是直男的快樂密碼 發布:2025-09-16 12:22:32 瀏覽:911
修改資料庫存儲引擎 發布:2025-09-16 12:21:48 瀏覽:78
安徽調度伺服器品牌雲伺服器 發布:2025-09-16 12:02:17 瀏覽:778