只是需要一些想法选择Count行然后更新值
有没有一种方法可以让我选择计数,然后更新它的价值呢?
这是我的代码进行编辑。
我得到我的表中的新邮件的数量message
select count(id) as new from message where owner_id = '1' and status = '1' and isRecieve = '0'
当我得到消息的数量,我希望它设置所有message
得到了select
查询isRecieve = 1
有没有办法,一旦我查询我updte所有isRecieve 1?
像
select count(id) as new from message where owner_id = '1' and status = '1' and isRecieve = '0' then update isRecieve = 1
感谢。