select tab.bg as Bloog_group,tab.supp_quan-tab.don_quan as Excess_blood
from
(select donotor.bg as bg,sum(donotor.quan) as don_quan,sum(supplier.quan) as supp.quan from
donotor join supplier
on donotor.bg=supplier.bg
group by donotor.bg) tab
where tab.don_quan
from
(select donotor.bg as bg,sum(donotor.quan) as don_quan,sum(supplier.quan) as supp.quan from
donotor join supplier
on donotor.bg=supplier.bg
group by donotor.bg) tab
where tab.don_quan
No comments:
Post a Comment