0
Greetings,
I wonder if it is possible to select a table period without using a subquery as an example below:
Select Usuario, Divida.Janeiro , Divida.Fevereiro, Divida.Marco ... from Usuarios a
left join VW_Dividas_Por_Mes b on a.cod_user = b.cod_user
In this case I have a view that brings results by date where dt_divida between '01/01/2020' and '31/01/2020'
but I wanted to display only one month to month in select, without having to perform a subquery or specify the date in Join.
That’s possible?
What is "view" like? It column ?
– Motta
The view would be: cod_user, dt_divide, value
– Arcyde
You could make a case , something like sum(case when to_char(dt_divida,'yyyymm') = '202001' then value Else 0 end) ..., but I think the cost will be worse.
– Motta