读书人

跪求SQL update有关问题

发布时间: 2012-01-13 22:43:29 作者: rapoo

跪求SQL update问题
例如有A表和B表用SQL 语句比较如果A表中有的数据B表中没有那么将这条数据的某列的字段修改!!!急急请教

[解决办法]
update a set a.flag=1 where not exists (select 1 from b where b.field=a.field)

读书人网 >SQL Server

热点推荐