当前位置:首页 » 编程语言 » 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上加个触发器

热点内容
构成c语言程序的基本单位 发布:2025-02-04 13:49:53 浏览:988
如何修改已经更改的密码 发布:2025-02-04 13:38:38 浏览:772
唐dm2021买哪个配置划算 发布:2025-02-04 13:38:38 浏览:627
真空压缩重 发布:2025-02-04 13:38:37 浏览:639
alias脚本 发布:2025-02-04 13:38:03 浏览:739
linux终端字符 发布:2025-02-04 12:52:40 浏览:734
c语言程序设计mobi 发布:2025-02-04 12:51:55 浏览:259
rsa算法c语言 发布:2025-02-04 12:50:36 浏览:785
阿里云服务器托管破解 发布:2025-02-04 12:47:43 浏览:257
汽车都有什么配置 发布:2025-02-04 12:42:51 浏览:458