Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT nb.service_id, (nb.summ - ac.summ), nb.summ, ac.summ, nb.service_id, ac.service_id
- FROM n_accountservice ass
- JOIN n_balances nb ON nb.account_id = ass.account_id and nb.service_id = ass.service_id
- JOIN n_accruals ac ON ac.account_id = ass.account_id AND ac.service_id = ass.service_id
- WHERE --ass.state_srv = 1 AND
- ass.account_id = '000000204909'
- AND nb.DATA = add_months(trunc(to_date('01.08.2017','dd.mm.yyyy'), 'mm'), -2)
- AND ac.DATA = add_months(trunc(to_date('01.08.2017','dd.mm.yyyy'), 'mm'), -1)
- -- AND nb.summ <= ac.summ
- ;
- 27 0 0 0 27 27
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement