Skip to content
Advertisement

SQL pivot and group by month

I’m trying to get the sum of production per month and pivot the month row to columns. Could you please tell me what is wrong with this code?’

Advertisement

Answer

There were several items wrong in your query. Columns need aliases and your max() within the PIVOT was referencing an invalid column name

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