Guest User

Untitled

a guest
Feb 13th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment