SQL - controle de debito e credito |
Top Previous Next |
|
select (Select sum(qtd) as soma from controle where c_produto = 1 and c_forneced = 1 and dt_lanc between '06/13/2000' and '06/14/2000' and status = 'D' group by status) as debito, (Select sum(qtd) as soma from controle where c_produto = 1 and c_forneced = 1 and dt_lanc between '06/13/2000' and '06/14/2000' and status = 'C' group by status) as credito, count(*) as numreg from controle |