---我的报价与平均报价比较
--PartnerID 商家
--productID 产品
--QuoteValue 报价
select productID,QuoteValue,sum(select QuoteValue from PT_Prod_Quote where ProductID = Q.ProductID )
from PT_Prod_Quote Q where PartnerID = 17 group by ProductID
此方法不行
------解决方案--------------------
PT_Prod_Quote 都是在同一张表上拉
select productID,QuoteValue,sum( QuoteValue)
from PT_Prod_Quote Q where PartnerID = 17 group by ProductID
------解决方案--------------------
select productID,QuoteValue
from PT_Prod_Quote ,(
select productID,sum(QuoteValue) / sum(1) aa
from PT_Prod_Quote
group by productID ) bb
where bb.productID = PT_Prod_Quote.productID