Created
October 17, 2011 21:13
-
-
Save hermansc/1293837 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT sc.id, sc.title, sh.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 = sh.id) | |
JOIN auth_user u ON (shift.owner_id = u.id) | |
WHERE sc.owned_by_id IN( | |
SELECT sch.owned_by_id | |
FROM aktive_verv av | |
JOIN shiftmanager_schedule sch ON (sch.owned_by_id = av.gruppe_id) | |
WHERE av.medlem_id = 1012912) OR sc.owned_by_id IN (SELECT sc.owned_by_id FROM shiftmanager_shift shift | |
JOIN shiftmanager_schedule_shifts sh ON (shift.id = sh.shift_id) | |
JOIN shiftmanager_schedule sc ON (sc.id = sh.schedule_id) | |
JOIN auth_user au ON (shift.owner_id = au.id) | |
WHERE au.id = 1012912); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment