答案 0 :(得分:3)
是否总是要订购ID? 如果是这样,您想要的是选择ID比Tom的ID大的行
SELECT * FROM employees WHERE Id > (SELECT Id FROM employees WHERE Name = 'Tom');
答案 1 :(得分:2)
这是你在找什么吗?
SELECT t.*
FROM table t
WHERE t.id = (SELECT MAX(t1.id)
FROM table t1
WHERE t1.position = t.position AND t1.department = t.department
);
答案 2 :(得分:1)
尝试一下:
select *
from TABLE_NAME
where Id > (select Id from TABLE_NAME where Name = 'Tom')