Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. SELECT * FROM((SELECT C.CANID as ID, (coalesce(CAtt.canlastname,''::text)||' '::text||coalesce(CAtt.canfirstname,''::text)||' '::text||coalesce(CAtt.cansurname,''::text)) as name, 'can'::text as Type, 2 as TypeDesc, 'o'::text as ot, C.createDate, 0 as lasteventid, VRUB.rsname, CATT.cansourceid
  2. FROM HR$CANDIDATE C
  3. INNER JOIN HR$CANATT CAtt ON (CAtt.canId = C.canId)
  4. LEFT OUTER JOIN VV$RUBSECTION VRUB ON (VRUB.rsid = CATT.cansourceid)
  5. WHERE ((C.canislimitaccess = 0) OR (C.canid in (-1)))
  6. ORDER BY name asc, createdate desc, id asc
  7. LIMIT 100 OFFSET 0)
  8. UNION
  9. (SELECT grp.gcid as id, grp.gcname as name, 'gcan'::text as type, CASE WHEN grp.grkind = 3 THEN 0 ELSE 2 END as typedesc, null as ot, cast(null as date) as createDate, 0 as lasteventid, null as rsname, null as cansourceid
  10. FROM HR$CANGROUP grp
  11. ORDER BY name asc, createdate desc, id asc
  12. LIMIT 100 OFFSET 0)) AS S WHERE (upper(type) != ?) ORDER BY name asc, createdate desc, id asc limit ? offset ?:-1##12##100##4##0##4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement