daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (select 'beginning'::varchar as t_date, sum(movementqty) as qty
  2. from m_transaction
  3. where m_product_id='0015779EEE8D4EA8A0E54228C4408B23'
  4. and movementdate<'2017-04-01')
  5.  
  6. union all
  7.  
  8. (select movementdate::date::varchar as t_date, sum(movementqty) as qty
  9. from m_transaction
  10. where m_product_id='0015779EEE8D4EA8A0E54228C4408B23'
  11. and movementdate>='2017-04-01'
  12. and movementdate<='2017-05-01'
  13. group by movementdate
  14. order by movementdate)
  15.  
  16. union all
  17.  
  18. (select 'saldo'::varchar as t_date, sum(movementqty) as qty
  19. from m_transaction
  20. where m_product_id='0015779EEE8D4EA8A0E54228C4408B23'
  21. and movementdate<='2017-05-01')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top