子查询更新多个字段值

来源:互联网 发布:mac中返回主界面图标 编辑:程序博客网 时间:2024/06/05 03:41

正确语句:
update A set  `status` = 0  where activityId in (

select b.activityId from ( select  activityId from A where  date_sub(startTime,interval -1 day) <= date_sub(NOW(),interval 0 day) ) as b

错误语句


update A  set  `status` = 0  where activityId in (
select  activityId from A where  date_sub(startTime,interval -1 day) <= date_sub(NOW(),interval 0 day) )

原创粉丝点击