Created
September 1, 2011 19:20
-
-
Save hobodave/1187011 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| sp.user_id | |
| FROM shop_pagers sp | |
| WHERE sp.user_id NOT IN ( | |
| SELECT | |
| owner_id | |
| FROM tickets | |
| WHERE ticket_status NOT IN (3,4,7) | |
| ) | |
| AND sp.shop_id = 1; | |
| SELECT | |
| sp.user_id | |
| FROM shop_pagers sp | |
| LEFT JOIN tickets t ON t.owner_id = sp.user_id AND t.ticket_status NOT IN (3,4,7) | |
| WHERE t.id IS NULL | |
| AND sp.shop_id = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment