Quantcast
Channel: Questions in topic: "distinct"
Viewing all articles
Browse latest Browse all 38

Select DISTINCT from one column but ORDER BY another

$
0
0
I have a table with repeating Name column already in a specific order that I need to pull out only the DISTINCT values from Name column but they must stay in the order they are in the table. I thought I could do this by creating another column and call it Order, but I do not want the Order column to return at all, only the Name column. Name Order G 1 G 1 G 1 C 2 C 2 P 3 P 3 P 3 M 4 M 4 M 4 M 4 M 4 M 4 M 4 M 4 M 4 S 5 S 5 S 5 S 5 S 5 S 5 I need the above to return only. Name G C P M S and in that order

Viewing all articles
Browse latest Browse all 38

Trending Articles