我想要油型的总和
where fullname = gift and
FDate = '01-10-2023' and vehicalType = 'car'
也是油型的总和
where fullname = 'gift' and
FDate = '01-10-2023' and vehicalType = 'motorcycle'
在单一查询中。
我写了这段代码,但没有工作。
Select vehicalType, sum(total) as total ,fullname, FDate
from paking_histories
where FDate = '01-10-2023' and oiltype ='oil' and Fullname ='gift';
需要的结果。
Car motorcycle date
Total total 01-10-2023
1条答案
按热度按时间uplii1fm1#
您可以使用条件聚合: