How can I write this SQL SELECT query for this table?
I have this situation in a certain table:
id | name
1 'Test'
2 'Test'
3 'Test'
How can I make a query to SELECT
by distinct the name? I also need the ID column, even if I get the first occurrence of the element, e.g. "开发者_Go百科if the name column repeats, give me the first record with this repetition."
select name, MIN(ID)
from aCertainTable
group by name
精彩评论