oracle查询过滤为一条数据,修改另一个表的数据

user 相同身份证号码可能有多条数据,进行过滤

school 相同身份证号码也有可能有多条数据,关联条件用 in

update school set xb ='1' where l.id in(select xb from user )

sfzhm

oracle数据库:

update school l set name = (select name from user where statu='10' and and l.id =s.id and rownum = 1)

金仓数据库:

update school l set name = (select name from user where statu='10' and and l.id =s.id and limit 1)

 

posted @ 2024-07-25 16:17  贩卖长江水  阅读(23)  评论(0)    收藏  举报