Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (select 'beginning'::varchar as t_date, sum(movementqty) as qty
- from m_transaction
- where m_product_id='0015779EEE8D4EA8A0E54228C4408B23'
- and movementdate<'2017-04-01')
- union all
- (select movementdate::date::varchar as t_date, sum(movementqty) as qty
- from m_transaction
- where m_product_id='0015779EEE8D4EA8A0E54228C4408B23'
- and movementdate>='2017-04-01'
- and movementdate<='2017-05-01'
- group by movementdate
- order by movementdate)
- union all
- (select 'saldo'::varchar as t_date, sum(movementqty) as qty
- from m_transaction
- where m_product_id='0015779EEE8D4EA8A0E54228C4408B23'
- and movementdate<='2017-05-01')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement