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……(省略了)‘
就不能执行了
人气:111 ℃ 时间:2020-02-05 17:30:13
解答
select * from (select *from b) as xxx where
select * from (select *from b) xxx where
确实是一样的,但是第三句相当于
select * from (select *from b) where
这个有错误.
推荐
- SQL语句理解 select * from B where (select count(1) as num from A where A.ID = B.ID) = 0
- SQL的执行顺序,如:( Select,From,Where Group By , Order By)如何的顺序
- 已知向量a等于(2sinx,cosx+sinx),向量b=(根号3cosx,sinx-cosx)定义f(x)=向量a*向量b
- 1.又甲乙两杯含盐量不同的水,甲杯盐水重100克,乙杯盐水重60克.现在从两杯中到处等量的盐水,分别交换倒入两杯中,这是两杯新盐水的含盐量相等,从每杯倒出盐水多少克?
- 已知3x^2(m+5)-1y^3与-2y^-3(n+1)x^-(m+6)是同类项
- 已知直线y=根号3/3x+1和x、y轴交于A、B两点,以线段AB为边在第一象限内作一个等边三角形ABC
- run的现在进行式那个n要双写再加ing吗?
- (Having been given)the wrong number,she couldn't get in touch with her friend lisa.
猜你喜欢