having用法
展开阅读全文
SELECT count(`id`) as ceshi ,count(`ids`) as cishi FROM `think_ceshi`  having ceshi >100 and cishi < 100 order by ceshi desc

注意问题:having不能加在order by后面,但是可以在group by 后面