user pubs
go
1.
declare @str varchar(1000)
set @str = ''
select @str = @str + fname + ' - ' from employee where job_id = 5
order by hire_date
print @str
2.
declare @str varchar(1000)
set @str = ''
select @str = @str + fname + ' - ' from employee where job_id = 5
--order by hire_date
print @str
3.
declare @str varchar(1000)
set @str = ''
select @str = @str + fname + ' - ' from (select top 99 percent * from employee where job_id = 5 order by hire_date) b
print @str
4.
declare @str varchar(1000)
set @str = ''
select @str = @str + fname + ' - ' from (select top 100 percent * from employee where job_id = 5 order by hire_date) b
print @str
查询结果很令我吃惊,想知道为什么,谢谢