SELECT currency_id, COUNT(*) AS "Count" FROM tablea WHERE currency_id = 0 GROUP BY currency_id HAVING COUNT(*) >= 3;
[注意]
- 语法位置
- where条件语句中的条件必须在select中,否在会报错;比如上面的例子,虽然表 tablea中有字段gender,但是select没有把gender字段拿出来,这样我们在where条件语句中就不能对gender列进行筛选操作;
(完)
2022-08-23 17:32:38
SELECT currency_id, COUNT(*) AS "Count" FROM tablea WHERE currency_id = 0 GROUP BY currency_id HAVING COUNT(*) >= 3;
[注意]
(完)