I want to get the users(Gebruiker) that used their card(pas) for N amount of times between 2 dates.
Now I tried to use HAVING COUNT or some variation of that, to get the amount of times a row contains a foreign key and use that to filter out everyone that used it atleast 5 times between 2 dates.
This is what I tried but without the date:
SELECT *, COUNT(Pas_pasnummer)
FROM gebruiker
INNER JOIN pas_has_poort ON gebruiker.gebruikernummer=pas_has_poort.Pas_pasnummer
HAVING COUNT(Pas_pasnummer) = '1'
