I want to get the following output
enrollment_month | weekend_revenue | weekday_revenue |
---|---|---|
jun | 550 | 790 |
may | 1570 | 2020 |
this is the code I have:
select g.enrollment_month, sum(g.total_revenue) as weekday_revenue
from gracieMusicFact g
where g.lesson_day in ('Monday','Tuesday','Wednesday','Thursday','Friday')
group by enrollment_month;
select g.enrollment_month, sum(g.total_revenue) as weekend_revenue
from gracieMusicFact g
where g.lesson_day in ('Saturday','Sunday')
group by enrollment_month;
Union only gives me either one of the weekend_revenue or weekday_revenue. How do I make two different select statements with different criteria?
Thanks
Edit: Using union all gives me this outpu:
| enrollment_month | weekday_revenue |
| jun| 790 |
| may| 2020 |
| jun| 550 |
| may| 1570 |