Skip to content

Instantly share code, notes, and snippets.

@primogf
Created May 23, 2017 18:15
Show Gist options
  • Save primogf/9450345ad14257d7f91899c136499c7a to your computer and use it in GitHub Desktop.
Save primogf/9450345ad14257d7f91899c136499c7a to your computer and use it in GitHub Desktop.
select
t.id_transacao_contabil,
t.somatorio_lancamentos,
sum(ti.valor) as somaValores
from
AccountingTransaction t
inner join AccountingTransactionItem ti on ti.id_transacao_contabil = t.id_transacao_contabil and ti.stat <> 0 and ti.natureza = 'D'
where
t.stat <> 0
group by t.id_transacao_contabil order by t.id_transacao_contabil;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment