Skip to content
Advertisement

Combining multiple SQL select statements as columns

Combining multiple select statements as a columns, is not giving the desired output. What I’m missing here? Group by clause is not working as expected. Do I need to use GroupBy for outer Select as well.?

SQL Query:

Current Output: Showing data of 144 rows for 2020

Output I’m looking: Should show data of 12 months for the year 2020

Advertisement

Answer

Do you just want conditional aggregation:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement