I have a table with clients: id, name, email and the likes
I am looking to find all ID's where emails are the same, I tried the following
select db_email, db_medlem, count(*) from kunder group by db_email HAVING count(*) > 1;
however this generates an error due to not grouping on db_medlem as well
Column 'kunder.DB_MEDLEM' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Obviously I cannot group on db_medlem since I am only looking for dublicates in the email field.
Any ideas on this?