Skip to content

Instantly share code, notes, and snippets.

@hermansc
Created October 17, 2011 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hermansc/1293480 to your computer and use it in GitHub Desktop.
Save hermansc/1293480 to your computer and use it in GitHub Desktop.
SELECT sch.id, sch.title, shift.id, shift.begin, shift.end, shift.unwanted as w, u.username
FROM shiftmanager_schedule sc
JOIN shiftmanager_schedule_shifts sh ON (sc.id = sh.schedule_id)
JOIN shiftmanager_shift shift ON (shift.id IN (SELECT temp.shift_id FROM shiftmanager_schedule_shifts temp WHERE temp.schedule_id = sh.id)
JOIN aktive_verv ON (av.medlem_id = shift.owner_id)
JOIN auth_user u ON (av.medlem_id = u.id)
WHERE av.medlem_id = 1012912;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment