开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜