Hi i need information about how to merge both sentences
Sentence 1
select idlote from polizamovtos group by idlote having sum(cargo)-sum(abono) > 0
Sentence 2
SELECT SUM(cargo) as saldo FROM polizamovtos WHERE FECHAMOVTO='2020-01-01' GROUP BY IDLOTE
sentence 1 is the main filter
Hi, I attach more information
Output expected
idlote cargo
1 4000
3 4000
4 5000
Go to Source
Author: Sergio Rossetti