2
I have a query in which I take monthly deposited values it takes everything it has in the base and shows the months that were entered in the base.
I would like to do different I would like to show also the months that had no deposit I would like to bring zeroed as the image below my bank is the Postgres.
How It Brings Today
How Would You Like to Bring
Query
SELECT to_char(fi.data,'yyyy/mm') as Mês, count(fi.*) as valor
FROM financeiro fi
WHERE fi.status = '1'
GROUP BY Mês
ORDER BY Mês;
A solution for Oracle, see help http://forum.imasters.com.br/topic/522521-forcar-select-trazer-linha-mesmo-que-sem-valor/
– Motta
I tried to ride here but it didn’t work
– Shaolin Fantastic
will be by year, will have a filter?
– novic
http://forum.imasters.com.br/topic/278755-numero-da-linha-no-mysql-tipo-rownum-no-oracle/
– Motta
For months @Virgilionovic
– Shaolin Fantastic
but for example you choose the year or this for you is helpless?
– novic
For now it’s indifferent
– Shaolin Fantastic
Is it Mysql or postgresql? Please specify, the solution may be different in each case.
– Bacco
I specified the Bank is Postgres
– Shaolin Fantastic