当使用SELECT count(`did`) FROM `example` group by `deal_id` having `userid`=52 and `did`=46查询时,语句报错,说没有userid这个字段
但是SELECT *,count(`did`) FROM `example` group by `deal_id` having `userid`=52 and `did`=46在phpmyadmin中却是正常
在官网上找到一句描述:
In standard SQL, a query that includes a GROUP BY
clause cannot refer to nonaggregated columns in the HAVING
clause that are not named in the GROUP BY
clause.
更新字符串中的某个字符
update v9_recharge_data set content=replace(content,'<','<') where id = 2;
两个条件并列:
SELECT * FROM `order` WHERE ( id <5 AND bankid =11 ) OR (id >8 AND bankid =1) LIMIT 0 , 30