Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. select *
  2. from
  3. kop.af_coil_last_gk_v c
  4. join kop.af_req_v r on r.row_id=c.row_id
  5. left join kop.af_nss_shop_list_v sl on (to_char(r.shop) = (
  6. case
  7. when sl.shop_code = '160'
  8. then '117'
  9. else sl.shop_code
  10. end
  11. ))
  12. left join af_nss_flow_v f on (f.flow_code=r.flow and sl.shop_descr=f.shop)
  13. where
  14. date_prod between
  15. to_date('23.10.2016 20:00:00', 'dd.mm.YYYY HH24:MI:SS')
  16. and to_date('24.10.2016 19:59:59', 'dd.mm.YYYY HH24:MI:SS')
  17. and nvl(c.stan_num,'2000')='2000'
  18. and nvl(c.rate, 'Г')<>'БРАК'
  19. and f.shop = 'ЛПЦ-5'
  20. and f.flow_code = 14;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement