Guest User

Untitled

a guest
Jan 17th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. SELECT DISTINCT
  2. a c.coreID,
  3. c.coreLabel,
  4. a.phaseOrderBy,
  5. a.weekOrderby,
  6. a.dayOrderBy,
  7. c.groupID,
  8. a.woAID,
  9. a.phaseID,
  10. (CASE
  11. WHEN p.phaseID is null
  12. THEN CONCAT('NONE')
  13. ELSE p.phaseLabel
  14. END) as phaseLabel,
  15. a.weekID,
  16. a.dayID,
  17. (CASE
  18. WHEN w.weekLabel is null
  19. THEN CONCAT('NONE')
  20. ELSE W.weekLabel
  21. END) as weekLabel,
  22. c.uc,
  23. c.um
  24. FROM
  25. activity a
  26. LEFT JOIN phase p ON p.phaseID = a.phaseID
  27. LEFT JOIN core c ON c.coreID = a.coreID
  28. LEFT JOIN week w ON w.weekid = a.weekID
  29. WHERE
  30. c.orgID = :orgID AND
  31. c.userID = :userID
  32. ORDER BY
  33. c.coreLabel
  34. , a.phaseOrderBy
  35. -- , a.phaseID
  36. , a.weekOrderBy
  37. -- , a.weekID
  38. , a.dayOrderBy
  39. -- , a.dayID
Add Comment
Please, Sign In to add comment