select top 5 * from (select top 10 * from tab WHERE (tabA=1) ORDER BY ID ASC) as temp where ID not in(SELECT TOP 5 ID FROM tab WHERE (tabA=1) ORDER BY ID ASC) 这里temp貌似代替了前面查询的tab ,我把temp替换成tab 结果都是一样的
select top 5 * from (select top 10 * from tab WHERE (tabA=1) ORDER BY ID ASC) as temp where ID not in(SELECT TOP 5 ID FROM tab WHERE (tabA=1) ORDER BY ID ASC) 这里temp貌似代替了前面查询的tab ,我把temp替换成tab 结果都是一样的您把temp换成克林顿也是一样的。 select top 5 * from (select top 10 * from tab WHERE (tabA=1) ORDER BY ID ASC) as [克林顿] where ID not in(SELECT TOP 5 ID FROM tab WHERE (tabA=1) ORDER BY ID ASC)
如果是自定义函数,请贴出其内容。2:在存储过程里 str关键字起到什么作用?
联机丛书内容
2,str是一个函数,看#1
============
temp是什么关键字,肯定不是系统关键字。
这里temp貌似代替了前面查询的tab ,我把temp替换成tab 结果都是一样的
(select top 10 * from tab WHERE (tabA=1) ORDER BY ID ASC) as temp
where ID not in(SELECT TOP 5 ID FROM tab WHERE (tabA=1) ORDER BY ID ASC)
这里temp貌似代替了前面查询的tab ,我把temp替换成tab 结果都是一样的您把temp换成克林顿也是一样的。
select top 5 * from
(select top 10 * from tab WHERE (tabA=1) ORDER BY ID ASC) as [克林顿]
where ID not in(SELECT TOP 5 ID FROM tab WHERE (tabA=1) ORDER BY ID ASC)