SQL Distinct on multiple columns

I want to get the distinct set of rows based on the uniqueness of multiple columns

ex: I have a table last,first whose data is:

smith, john
smith, john
smith, fred

i want to run SQ - something similar to:
select distinct last,first from table;

should return:
smith,john
smith,fred
pmsguyAsked:
Who is Participating?
 
zx10rConnect With a Mentor Commented:
why don't you just use GROUP BY
0
 
HuyBDCommented:
Could you explain more
0
 
gamebitsConnect With a Mentor Commented:
In your example a simple distinct clause will return what you are looking for, would be different though if you add a third column

smith, john, 1
smith, john, 2
smith, fred, 1

Then a distinct query would return all three of them.
0
All Courses

From novice to tech pro — start learning today.