有没有人能跟我讲一下top 的原理,为什么不是顺序读
select top 15 tt.id from (select top 15 a.id from emlinfo a order by a.id) tt
select top 15 id from emlinfo
为什么结果会不一样
在线等请教
select top 15 tt.id from (select top 15 a.id from emlinfo a order by a.id) tt
select top 15 id from emlinfo
为什么结果会不一样
在线等请教
select top 15 id from emlinfo order by id
试一下!
select top 15 a.id from emlinfo a order by a.id
和
select top 15 id from emlinfo
--这个按照 id排序 之后取出前15条
select top 15 id from emlinfo
--这个没有排序直接取前15条
select top 15 id from emlinfo order by ID--加上排序
SELECT * FROM emlinfo SELECT * FROM emlinfo ORDER BY A.ID看这两个输出一样不一样,如果不一样分别取前15肯定也不一样了
SELECT top 15 id FROM emlinfo SELECT top 15 id FROM emlinfo ORDER BY ID
不一样怎么回事