Advertisement
Valik888

Untitled

Jan 26th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. SELECT nb.service_id, (nb.summ - ac.summ), nb.summ, ac.summ, nb.service_id, ac.service_id
  2. FROM n_accountservice ass
  3. JOIN n_balances nb ON nb.account_id = ass.account_id and nb.service_id = ass.service_id
  4. JOIN n_accruals ac ON ac.account_id = ass.account_id AND ac.service_id = ass.service_id
  5. WHERE --ass.state_srv = 1 AND
  6. ass.account_id = '000000204909'
  7. AND nb.DATA = add_months(trunc(to_date('01.08.2017','dd.mm.yyyy'), 'mm'), -2)
  8. AND ac.DATA = add_months(trunc(to_date('01.08.2017','dd.mm.yyyy'), 'mm'), -1)
  9. -- AND nb.summ <= ac.summ
  10. ;
  11. 27 0 0 0 27 27
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement