id name marks
1;"mohit";10
2;"mohit";20
3;"raj";30
4;"rupesh";40
5;"rupesh";50

预期产量为:
1;"mohit";10
4;"rupesh";40

最佳答案

试试这个

SELECT *
FROM Your_Table
WHERE ID IN (
             SELECT Min(ID)
             FROM Your_Table
             GROUP BY Name
             HAVING Count(*) > 1
)

关于sql - SQL查找表中第一个出现的行,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50921424/

10-11 18:40