1
I have a simple table in a FIREBIRD database:
idCliente: integer
dataPagamento: date
valor: numeric
How to make a select that adds up all amounts payable, grouping by month and year?
kind of:
select MES_ANO, sum(valor) from pagamento group by MES_ANO
unknown function
TO_CHAR
– Italo Rodrigo
It was bad, I confused with Oracle, I’m correcting, the function is date_format. I’ll edit the answer
– Felipe J. R. Vieira
sorry man, my mistake... is that I am working with two databases here. the correct database is Firebird
– Italo Rodrigo
To extract Month and year in Firebird is this command Extract(MONTH from dataPagamento) AS MES, Extract(YEAR from dataPagamento) AS ANO,
– Felipe J. R. Vieira