时间:2021-07-01 10:21:17 帮助过:40人阅读
update tbl
set isoption=1 where userguid='sss' pid in(select pid from tbl where activeid=1 and isoption=0 limit 3) 语法过不去 但是
update tblp set isoption1 where userguid='sss' and pid in(select t.pid from( select pid from tblpromotion where activeid=1 and isoption=0 limit 3) as t )
就可以。所以不明白其内部是如何优化SQL语句的。
获取当天信息
SELECT count(1) as num FROM tblcdkey WHERE DATE_FORMAT(providetime,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')
比t-sql方便。