Anyone know how to select only distinct names from the following table, taking only the name with the most recent year of birth:
Id Name YearOfBirth
1 Bob 1979
2 Barry 1945
3 Karl 2000
4 Barry 1966
5 Martin 1970
6 Martin 1951
I want to return the following results:
1 Bob 1979
3 Karl 2000
4 Barry 1966
5 Martin 1970
If I do an ordinary SELECT DISTINCT it returns duplicates of the names due to the non-distinct YearOfBirths.
It's got to be simple right?
Id Name YearOfBirth
1 Bob 1979
2 Barry 1945
3 Karl 2000
4 Barry 1966
5 Martin 1970
6 Martin 1951
I want to return the following results:
1 Bob 1979
3 Karl 2000
4 Barry 1966
5 Martin 1970
If I do an ordinary SELECT DISTINCT it returns duplicates of the names due to the non-distinct YearOfBirths.
It's got to be simple right?