Postgresql – Use different fields based on condition
I log the daily produced energy of my solar panels. Now I want to create a SQL statement to get the sum of produced energy for each month but separate columns for each year. I came up with the following…