Posts by imex • 1,387 points
52 posts
-
3
votes2
answers169
viewsA: How to Make a Scan in SQL
Here is a suggestion for testing using the function Max with the clause Over: select id, case when cpf_valido = 1 then max(id) over(partition by cpf) else id end as id_para, cpf from cliente…
-
2
votes1
answer56
viewsA: CASE RETURNING MORE THAN ONE LINE IN A SUBCONSULTA
Good morning, I think an alternative would be to use Top(1) with Order by within the subconsultation. As 'CREDIT' comes before 'DEBIT' in ascending order, the sub-allowance must return 'CREDIT' when…