select aa.ProNo,ProName,Price,TQuan,TQuan*Price 'Amount' from dbo.Product, (select ProNo,sum(Quantity) 'TQuan' from ProOut group by ProNo) aa where dbo.Product.ProNo=aa.ProNo 嵌套一下呀
create view V_Sale2 as select dbo.V_sale2_1.ProNo,ProName,Price,TQuan,TQuan*Price 'Amount' from dbo.Product, ( select ProNo,sum(Quantity) 'TQuan' from ProOut group by ProNo )t where dbo.Product.ProNo=t.ProNo go
select ProNo,sum(Quantity) 'TQuan' from ProOut group by ProNo) as V_Sale2_1这样写,为什么系统会认为V_Sale2_1是视图呢?
as
select dbo.V_sale2_1.ProNo,ProName,Price,TQuan,TQuan*Price 'Amount'
from dbo.Product,
(
select ProNo,sum(Quantity) 'TQuan' from ProOut
group by ProNo
)t
where dbo.Product.ProNo=t.ProNo
go
select ProNo,sum(Quantity) 'TQuan' from ProOut
group by ProNo) as V_Sale2_1这样写,为什么系统会认为V_Sale2_1是视图呢?