daily pastebin goal
30%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 55 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 (select max(categ) keep (dense_rank first order by datepr desc) categ
  9.           from shifts
  10.          where tabnom = state.tabnom)
  11.   from state
  12.    
  13. select (
  14.     select distinct First_Value(h.Categ) over (partition by h.Tabnom order by h.Datepr desc)
  15.     from SHIFTS h
  16.     where h.TabNom = s.Tabnom)
  17. from State s
  18.    
  19. select
  20.    (select SHIFTS.CATEG
  21.        from SHIFTS where SHIFTS.TABNOM = STATE.TABNOM  
  22.        order by SHIFTS.DATEPR desc
  23.        LIMIT 1
  24.    ) as CATEG
  25.  from STATE
  26.    
  27. select
  28.   ( select TAB1.CATEG as CAT1 from
  29.     ( select SHIFTS.CATEG as CAT2 from SHIFTS
  30.        where SHIFTS.TABNOM = STATE.TABNOM  
  31.        order by SHIFTS.DATEPR desc) as TAB1
  32.       where ROWNUM = 1
  33.    ) as CATEG
  34. from STATE
RAW Paste Data
Top