I have a mySQL table which contains rows based on payments.
Each row contains their e-mail address, so I want to write a query using mySQL and PHP to find out how many people have 2 or more entries in this table.
This is basically to know if they have paid us more than once, by buying two packages, or renewing a subscription.
What would be the best way to do this?
EDIT: I wrote the above off the top of my head. A quick test on Oracle shows that the syntax is slightly wrong and should be
But this might just be Oracle not allowing the aliased column in the having clause. I’m not sure what mySQL would allow.