1.通过row
select * from table
where rownum<(select count(*)+1 from table)
minus
select * from table
where rownum<(select count(*) from table) 也可以简化为
select * from table
minus
select * from table
where rownum<(select count(*) from table)
效果是一样的 切记rownum是伪列 只能用< 顺便给你求第X行的通用SQL语句
select * from table where rownum<X+1
minus
select * from table where rownum<X
2.top
select top 1 * from person order by id desc
select top(1) * from table where id=(select max(id) from table)
3.max
select * from table a where a.date in (select max(b.date) from table b where b.id=a.id)