这个一条查询语句该怎么写?
Select VehicleBrands,sum(Amount) from CostReports
where CostReports.CostType = 1 and CreateTime between StartDate and EndDate
group by VehicleBrands
Select VehicleBrands,sum(Amount/ApportionMonth)
from CostReports
where CostReports.CostType = 2 and ThisMonth < StartMonth + ApportionMonth
and ApportionMonth > 0
group by VehicleBrands
select VehicleBrands,sum(Amount)
from CostReports
where CostReports.CostType = 3
group by VehicleBrands
如何将这三条语句查询的的结果进行累加
Select VehicleBrands,sum(第1种查询的结果+第2种查询的结果+第3种查询的结果) as ReportCost
from CostReports
group by VehicleBrands
注意:第X种查询的结果用查询语句表示
[ 本帖最后由 等待冰柠檬 于 2010-8-5 15:19 编辑 ]