Good afternoon, I have a big question in my query, I have a table with the following info:
Iwouldliketogetthefollowingresult
I need the result to be the total amount of (payment forms) per day, divided by period in two columns, M and N.
I think it's a very simple query, but I'm breaking my head and I'm not getting it. I've already tried using GROUP BY .
I found some tips on using PIVOT but I could not do SUM as this tool.
I got this query, but it is not what I want, it brings me the total of the day, not the total for the period I want.
My Query:
SELECT data, (SELECT format(SUM(valor),2,'de_DE') WHERE periodo = 'N') AS N, (SELECT format(SUM(valor),2,'de_DE') WHERE periodo = 'M') AS M FROM floja1 WHERE extract(month FROM data) = '05' GROUP BY data ORDER BY data
Thank you in advance.
Att; Danilo