查询第31-40条记录的SQL查询语句:
select * from (select top 40 * from msaleslog order by tno desc ) a where tno not in (select top 30 Tno from msaleslog order by Tno desc ) order by tno desc ;
查询表 msaleslog 的第31-40条记录,按 tno 降序排列。
本文介绍了一种特殊的SQL查询方法,用于获取表msaleslog中第31-40条记录,并按tno字段降序排列。这种方法通过组合使用TOP和NOT IN子句实现,适用于需要精确控制返回记录范围的情况。
查询第31-40条记录的SQL查询语句:
select * from (select top 40 * from msaleslog order by tno desc ) a where tno not in (select top 30 Tno from msaleslog order by Tno desc ) order by tno desc ;
查询表 msaleslog 的第31-40条记录,按 tno 降序排列。
1060

被折叠的 条评论
为什么被折叠?
