ms sql :select * from (select *from b) as xxx where 和 select

问题描述:

ms sql :select * from (select *from b) as xxx where 和 select * from (select *from b) xxx where区
select * from (select *from b) as xxx where…… 和 select * from (select *from b) xxx where……的区别
别告诉我是一样的.
因为我有一个存储过程
set @query= 'select *
from (select Food.*,Supplier.SupplierName,Row_number()over( '+@orderQuery+' ) as IDRank from '+@tableName+' ' +@checkQuery+' ) xx
where xx.IDRank between ……(省略了)'
这个是对的.
我改成
set @query= 'select *
from (select Food.*,Supplier.SupplierName,Row_number()over( '+@orderQuery+' ) as IDRank from '+@tableName+' ' +@checkQuery+' ) as xx
where IDRank between……(省略了)‘
之后,也可以执行
但是如果改为
set @query= 'select *
from (select Food.*,Supplier.SupplierName,Row_number()over( '+@orderQuery+' ) as IDRank from '+@tableName+' ' +@checkQuery+' )
where IDRank between……(省略了)‘
就不能执行了
1个回答 分类:综合 2014-11-09

问题解答:

我来补答
select * from (select *from b) as xxx where
select * from (select *from b) xxx where
确实是一样的,但是第三句相当于
select * from (select *from b) where
这个有错误.
 
 
展开全文阅读
剩余:2000
上一页:周五
下一页:责任的事实论据