Reputation: 17
I need help with the following query i have 2 tables first one location with primary key no_location and one of the entry no_membre and second table membre with no_membre as primary key and entries prenom_membre and nom_membre I need to know how to get prenom_membre and nom_membre of members that did more than 25 location. thank you in advance
Upvotes: 2
Views: 31
Reputation: 2073
use HAVING clause to determine the result set to have more than 25 locations.
SELECT prenom_membre,
nom_membre,
COUNT(no_location)
FROM membre m
JOIN location l
ON m.no_membre = l.no_membre
GROUP BY prenom_membre,
nom_membre
HAVING COUNT(no_location) > 25
Upvotes: 1