34,590
社区成员
发帖
与我相关
我的任务
分享
update tab2 set
ksbm=(select top 1 ksbm from tb1 where tb1.id=tb2.id and tb1.ksbm<>null and tb1.ysbm<>null),
ysbm=(select top 1 ysbm from tb1 where tb1.id=tb2.id and tb1.ksbm<>null and tb1.ysbm<>null)
where tab2.ksbm=null and tab2.ysbm=null
update 表
set ksbm=(select top 1 ksbm from 表 where a.id=id),ysbm=(select top 1 ysbm from 表 where a.id=id)
from 表 a
where kdbm is null and ysbm is null