How would I filter the count column in the query below to show me only rows that have a count > 1?
select FirstName, COUNT(*) as [CountTickets] from tblParkingTickets
group by FirstName
order by [CountTickets] desc
This doesn’t work:
select FirstName, COUNT(*) as [CountTickets] from tblParkingTickets
where [CountTickets] > 1
group by FirstName
order by [CountTickets] desc
Thanks
with
HAVING:WHEREfilters before the group by (and thereforeCOUNTdoesn’t mean anything).HAVINGfilters after grouping.