回答:
これを試して;
select gid
from `gd`
group by gid
having count(*) > 10
order by lastupdated desc
AND ((stock = 1 OR quantity > 0) OR (COUNT(v.id) > 0)
HAVING variations > 0 OR (stock = 1 OR quantity > 0)
あなたが何をしようとしているのかよくわかりません...
SELECT gid, COUNT(*) AS num FROM gd GROUP BY gid HAVING num > 10 ORDER BY lastupdated DESC
num
ます。とにかくクリーンな構文のために+1(私のセットアップ、またはms ...ああ、そうでしょう)
SELECT COUNT(*)
FROM `gd`
GROUP BY gid
HAVING COUNT(gid) > 10
ORDER BY lastupdated DESC;
編集(gidsが必要な場合のみ):
SELECT MIN(gid)
FROM `gd`
GROUP BY gid
HAVING COUNT(gid) > 10
ORDER BY lastupdated DESC
条項なしのアカデミック版:
select *
from (
select gid, count(*) as tmpcount from gd group by gid
) as tmp
where tmpcount > 10;