Skip to content
Advertisement

MYSQL show all rows where no duplicates found

If I had a set of data like this:

What would be the SQL query to display only “James Peters”. So I am not wanting to remove duplicates (DISTINCT command) but rather show all rows where there are no duplicates found.

Advertisement

Answer

You would use group by for this with a having clause:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement