0
Good Afternoon, I have a big question in my query, I have a table with the following info:
I would like the following result
I need the result to be the total value of (forms of payments) per day, divided by period into two columns, M and N.
I believe it is a very simple query, but I’m breaking my head and I’m not getting it.. I’ve tried to use all the GROUP BY.
I found some hint talking to use the PIVOT but I couldn’t do the SUM like this tool.
I got to this query, but it’s not what I want, it brings me the total of the day, not the total of the period as 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
Thanks in advance.
Att. Danilo
Thank you so much! That’s what I wanted!
– Danillo Braga