Created
January 7, 2013 07:47
-
-
Save anonymous/4473163 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 | |
`relationships_relationship`.`id`, | |
`relationships_relationship`.`source_id`, | |
`relationships_relationship`.`target_user_id`, | |
`relationships_relationship`.`target_project_id`, | |
`relationships_relationship`.`created_on`, | |
`relationships_relationship`.`deleted` | |
FROM | |
`relationships_relationship` | |
INNER JOIN `users_userprofile` ON (`relationships_relationship`.`source_id` = `users_userprofile`.`id`) | |
WHERE (`relationships_relationship`.`source_id` IN | |
(SELECT U0.`user_id` FROM `projects_perusertaskcompletion` U0 | |
INNER JOIN `content_page` U1 ON (U0.`page_id` = U1.`id`) | |
WHERE (U0.`unchecked_on` IS NULL AND U1.`project_id` = 355 AND U1.`deleted` = False ) | |
GROUP BY U0.`user_id`, U0.`user_id` HAVING COUNT(U0.`page_id`) = 4 ORDER BY NULL) | |
AND `users_userprofile`.`deleted` = False AND `relationships_relationship`.`target_project_id` = 355 ) | |
LIMIT 56; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment