mysql alias for where conditional query.

select  id, name ,sum(count) csum from mytable  where name='张三'  HAVING (csum>100)

 

 

Note that there is no need to add and before HAVING

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326251601&siteId=291194637