daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select  (
  2. select CATEG from
  3. (select CATEG  from SHIFTS where TABNOM = STATE.TABNOM  order by TABNOM, DATEPR desc)
  4. where ROWNUM = 1
  5. )
  6. from STATE
  7.    
  8. select (
  9.     select distinct First_Value(h.Categ) over (partition by h.Tabnom order by h.Datepr desc)
  10.     from SHIFTS h
  11.     where h.TabNom = s.Tabnom)
  12. from State s
  13.    
  14. select  (
  15.     select LSHIFT.CAT2 as CAT1 from
  16.        (select SHIFTS.CATEG as CAT2
  17.            from SHIFTS where TABNOM = STATE.TABNOM  order by
  18.            TABNOM, DATEPR desc LIMIT 1) as LSHIFT
  19.        where ROWNUM = 1
  20. ) as CATEG from STATE
RAW Paste Data
Top