Let's say I have a table with 2 columns number and name.
number name
--------------
0 name1
3 name4
3 name2
5 name1
So the number column has repeats in it and one or more (distinct) names assigned to each number. But for example, number 3 could have the same name as number 5.
How do I show all the distinct names for each number using group by in such a way that I get as a result both number and name.
I am trying to do this but I can't figure it due to must having the columns in SELECT in GROUP BY also.