MySQL - Using COUNT(*) in the WHERE clause

前端 未结 9 1691
不思量自难忘°
不思量自难忘° 2020-11-28 20:55

I am trying to accomplish the following in MySQL (see pseudo code)

SELECT DISTINCT gid
FROM `gd`
WHERE COUNT(*) > 10
ORDER BY lastupdated DES         


        
9条回答
  •  温柔的废话
    2020-11-28 21:48

    try

    SELECT DISTINCT gid
    FROM `gd`
    group by gid
    having count(*) > 10
    ORDER BY max(lastupdated) DESC
    

提交回复
热议问题