Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- a c.coreID,
- c.coreLabel,
- a.phaseOrderBy,
- a.weekOrderby,
- a.dayOrderBy,
- c.groupID,
- a.woAID,
- a.phaseID,
- (CASE
- WHEN p.phaseID is null
- THEN CONCAT('NONE')
- ELSE p.phaseLabel
- END) as phaseLabel,
- a.weekID,
- a.dayID,
- (CASE
- WHEN w.weekLabel is null
- THEN CONCAT('NONE')
- ELSE W.weekLabel
- END) as weekLabel,
- c.uc,
- c.um
- FROM
- activity a
- LEFT JOIN phase p ON p.phaseID = a.phaseID
- LEFT JOIN core c ON c.coreID = a.coreID
- LEFT JOIN week w ON w.weekid = a.weekID
- WHERE
- c.orgID = :orgID AND
- c.userID = :userID
- ORDER BY
- c.coreLabel
- , a.phaseOrderBy
- -- , a.phaseID
- , a.weekOrderBy
- -- , a.weekID
- , a.dayOrderBy
- -- , a.dayID
Add Comment
Please, Sign In to add comment