通过SQL小组(计数,总和)

问题描述 投票:-2回答:1

你好,我需要帮助安博SQL中有此表

我需要这样的结果。

感谢您的关注和答案。

select 
to_char(r.date,'yyyy') YEAR,
sum(1),
sum(r.cafe) cafe,
sum(r.drink) drink,
sum(r.tea) tea
from ucet a
join  drinks r on a.IDT=r.IDT
join feat ce on a.IDT=ce.IDT
join dance c on a.ID= c.ID

group by to_char(r.date,'yyyy')
sql oracle
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.