我正在尝试在此查询中选择 nbre > 0 的项目:
SELECT c.id, c.nom, c.photo,
(SELECT count(*)
FROM touist_materiel
WHERE cat=c.id AND marque=7 AND actif=1
) as nbre
FROM touist_materiel_cat c
INNER JOIN touist_materiel m ON m.cat=c.id
WHERE nbre > 0
GROUP BY m.cat
ORDER BY c.nom
这个查询不起作用,我怎样才能让“nbre > 0”工作?谢谢