Comment compter le nombre d'éléments groupés par (GROUP BY)
Bonjour,
Je fais un sélect qui utilise GROUP BY
Code:
1 2 3 4 5 6
| SELECT fd_city_manif, fd_date_end, fd_nom_manif,id, fd_canton_manif
FROM manifestations
WHERE fd_date_end >= "'.date("Y-m-d").'"
AND fd_canton_manif LIKE "'.$key.'"
GROUP BY fd_city_manif
ORDER BY fd_city_manif ASC |
C'est utile car si j'ai trois ville "Chancy" et 5 "Bernex", il m'affichera 1x Chancy et 1x Bernex.
Simplement, devant chancy, j'aimerais bien afficher un nombre "3" qui correspond au 3 enregistrement de Chancy, et devant "Bernex" , le nombre 5, car il y a 5 enregistrement Concernant "Bernex"
Vu que j'utilise GROUP BY,
il y a pas un moyen de compter le nom d'élément groupé?