Created
December 6, 2012 17:58
-
-
Save joelpittet/4226558 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 u.uid, u.name, u.mail as email, u.status, | |
EXISTS ( | |
SELECT n.nid nid, NULL as uid FROM node n | |
WHERE n.type = 'manual' AND n.status = 1 AND nid NOT IN ( | |
SELECT fc.content_id nid FROM flag_content as fc | |
RIGHT JOIN node n ON (fc.content_type = 'node' AND fc.fid = 3 | |
AND fc.content_id = n.nid AND n.type = 'manual' AND n.status = 1) | |
WHERE fc.uid = u.uid | |
) | |
) as read_manuals | |
FROM users as u | |
LEFT JOIN users_roles ur ON u.uid = ur.uid AND ur.rid IN (4, 5, 30) | |
WHERE u.uid <> 0 AND ur.rid IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment