Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *
- from
- kop.af_coil_last_gk_v c
- join kop.af_req_v r on r.row_id=c.row_id
- left join kop.af_nss_shop_list_v sl on (to_char(r.shop) = (
- case
- when sl.shop_code = '160'
- then '117'
- else sl.shop_code
- end
- ))
- left join af_nss_flow_v f on (f.flow_code=r.flow and sl.shop_descr=f.shop)
- where
- date_prod between
- to_date('23.10.2016 20:00:00', 'dd.mm.YYYY HH24:MI:SS')
- and to_date('24.10.2016 19:59:59', 'dd.mm.YYYY HH24:MI:SS')
- and nvl(c.stan_num,'2000')='2000'
- and nvl(c.rate, 'Г')<>'БРАК'
- and f.shop = 'ЛПЦ-5'
- and f.flow_code = 14;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement