[ create a new paste ] login | about

Link: http://codepad.org/EKLkQiMf    [ raw code | fork ]

Plain Text, pasted on Apr 13:
select *
from reconcile_turn, reconcile_job, provider_station
where
   (
      reconcile_turn_id = rj_turn
      and (rj_provider = 157 or rj_provider is null)
   )
   and
   (
      rt_station = ps_station
      and
      (
         rj_provider = ps_provider
         or
         (
            rj_provider is null
            and ps_provider = 157
            and rj_job_type in (
               select psj_type
               from provider_station_jobtype
               where psj_ps_id = provider_station_id
                  and
                  (
                     (
                        rt_carrier_category = 'M'
                        and
                        psj_category in ('M', 'A')
                     )
                     or
                     (
                        rt_carrier_category = 'R'
                        and
                        psj_category in ('R', 'A')
                     )
                  )
            )
         )
      )
   )
   and rj_job_type = 'CTC'
   and rj_date between to_date('2018-03-16', 'YYYY-MM-DD') and to_date('2018-03-31', 'YYYY-MM-DD')
   and rj_state in ('COM', 'EXP', 'SCH', 'SKP', 'STA')
   and acceptance = 'D'
   and rt_station = 'JFK'
   and rt_fleet in ('737')
order by rt_in_arr_time asc;


Create a new paste based on this one


Comments: