Created
February 11, 2011 17:34
-
-
Save MisterPhoton/822715 to your computer and use it in GitHub Desktop.
SearchQuery
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 | |
a.accountId, | |
a.name AS accountName, | |
b.name AS businessName, | |
b.businessId, | |
n.employee_id AS teamUserId | |
FROM | |
Account AS a | |
JOIN Business AS b ON a.accountId = b.accountId AND b.deleted = 0 | |
JOIN user_notes AS n ON n.user_id = a.accountId AND n.deleted = 0 | |
WHERE | |
(b.name LIKE '%business%name%') OR | |
(a.name LIKE '%business%name%') | |
ORDER BY | |
b.name ASC | |
LIMIT 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment