select ((normalcost*25*0.5)+(schoolcost*25)) as "projectedcost"
from ( select count(orderno) as normalcost
from platterorder
where to_char(deliveryDate,'MON-YYYY')='APR-2013'
),
( select count(orderno) as schoolcost
from schoolorder
where to_char(deliveryDate,'MON-YYYY')='APR-2013'
);
上記のコードは完全に機能しますが、0.5 の代わりに discountpercent 列を追加しようとすると、エラーが表示されます
関連するテーブルは次のとおりです
PlatterOrder
( orderNo,
deliveryDate,
deliveryTime,
invoiced,
isBulk,
platterQuantity,
discountPercent,
clientNo
)
SchoolOrder
( orderNo,
deliveryDate,
deliveryTime,
invoiced,
taxExPercent,
clientNo
);