Is there a way to use DISTINCT (or another keyword) to not display duplicate results on one column? For example if I have a table with columns: id, name and countryCode
id name countryCode
1 Dan IE
2 John US
3 John UK
4 Bob DE
And I don't want to display duplicates where the name is the same so the result would be:
id name countryCode
1 Dan IE
2 John US
4 Bob DE
If I use DISTINCT here it needs to match the whole row but I only want to omit a row if the names match. Is there a way to do this? I found a similar solution here:DISTINCT for only one Column
But this does not work for mySQL. Any help would be much appreciated.