标签:des style strong sp on ef bs as sql
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
select top 1 * from person order by id desc
select top(1) * from table where id=(select max(id) from table)
select * from table a where a.date in (select max(b.date) from table b where b.id=a.id)
标签:des style strong sp on ef bs as sql
原文地址:http://www.cnblogs.com/yelongsan/p/4037476.html