I have a table with many columns, I want to return all columns but ignore duplicates based on one column
id | fullname | this | that | other
1 | Bob | 1 | 0 | 0
2 | Mary | 1 | 1 | 0
3 | Bob | 0 | 1 | 0
In the above example I need to only pull back one Bob row even though the data in fields other that fullname are different.
So I can't do
select distinct * from table
as this would pull back both Bobs
I can do
select distinct fullname from table
but this returns just the fullname column, I want all columns kind of like
select distinct fullname, * from table
but obviously that won't work. I tried a nested query and think that may be the way but am getting confused with that too
SELECT distinct fullname FROM (select * from table) as foo
How would I do this?
Thanks
id | fullname | this | that | other
1 | Bob | 1 | 0 | 0
2 | Mary | 1 | 1 | 0
3 | Bob | 0 | 1 | 0
In the above example I need to only pull back one Bob row even though the data in fields other that fullname are different.
So I can't do
select distinct * from table
as this would pull back both Bobs
I can do
select distinct fullname from table
but this returns just the fullname column, I want all columns kind of like
select distinct fullname, * from table
but obviously that won't work. I tried a nested query and think that may be the way but am getting confused with that too
SELECT distinct fullname FROM (select * from table) as foo
How would I do this?
Thanks