测试一下就知道 select top 5 * from (select top 15 * from table order by id asc) table_别名 order by id descselect top 15 * from table order by id asc: 按ID升序取前15条记录select top 5 * from (select top 15 * from table order by id asc) table_别名 order by id desc 在前15条记录中按ID倒序取5条,即15、14、13、12、11
select top 5 * from (select top 15 * from table order by id asc) table_别名 order by id descselect top 15 * from table order by id asc:
按ID升序取前15条记录select top 5 * from (select top 15 * from table order by id asc) table_别名 order by id desc
在前15条记录中按ID倒序取5条,即15、14、13、12、11
这是什么写法?还是你故意随手这么写的?
* 要用数字代替。建立测试数据,自己试验才是硬道理。