两表操作问题 表B 字段有BID, SM, CONNTENT等。 表A 字段有 AID, SM , STATUS 等现要求,根据B表SM字段值,如果A表中有记录与B表中的SM值相同,就把A表该条记录的STATUS值从N改成Y。望赐教,小弟菜鸟。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 update A set A.STATUS='Y' where A.SM=B.SM update A set status='Y' from B inner join A on A.sm=B.sm and A.status='N' update A set status='Y' from B left join A on A.sm=B.sm where A.status='N'update A set A.STATUS='Y' where A.SM=B.SM and A.status='N' UPDATE TA SET status='Y' FROM B WHERE A.SM=B.SM AND A.STATUS='N' update A set status='Y' from B left join A on A.sm=B.sm where A.status='N'update A set A.STATUS='Y' where A.SM=B.SM and A.status='N' update A set status ='Y' from A where exists(select 1 from B where SM=A.SM) update A set status ='Y' from A where exists(select 1 from B where SM=A.SM) update A set status ='Y' from A where exists(select 1 from B where SM=A.SM) sqlserver如何计算两个日期之差,精确到毫秒计算 mysql在linux平台下怎么授权??? 求简单sql语句 求sql语句 SQL2005里 :DROP TABLE IF EXISTS emp; 为什么会出错 遇到点小麻烦 一个查询的问题 模糊查询问题 100分 可能是简单问题,解决马上结贴......有兴趣请进 记录遍历的问题 字符串拆分问题!'2008-2-1 0'-->'2008-02-01' 高分求以下2个SQL语句
update A set status='Y' from B left join A on A.sm=B.sm where A.status='N'update A set A.STATUS='Y' where A.SM=B.SM and A.status='N'