Last active
August 29, 2015 14:17
-
-
Save Carmageddon/e108253f3878f153baa1 to your computer and use it in GitHub Desktop.
Sample query for Eloquent
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 "Subscription".* | |
FROM "Subscription" | |
JOIN "Account" ON "Subscription"."AccountID" = "Account"."AccountID" | |
JOIN "PayTool" ON "Subscription"."AccountID" = "PayTool"."OwnerAccountID" | |
WHERE | |
( | |
( | |
("AdminPhNumber" = '4578568' AND "AdminPhAreaCode" = '54') OR ("BillPhNumber" = '4578568' AND "BillPhAreaCode" = '54') or ("TechPhNumber" = '4578568' AND "TechPhAreaCode" = '54') OR ("PersPhNumber" = '4578568' AND "PersPhAreaCode" = '54') | |
OR | |
("AdminFaxNumber" = '4578568' AND "AdminFaxAreaCode" = '54') OR ("BillFaxNumber" = '4578568' AND "BillFaxAreaCode" = '54') or ("TechFaxNumber" = '4578568' AND "TechFaxAreaCode" = '54') OR ("PersFaxNumber" = '4578568' AND "PersFaxAreaCode" = '54') | |
) | |
OR ("PayTool"."CutNumber" LIKE '%1234' AND "Account"."TaxRegID" = '123456789') | |
) | |
AND "Subscription"."Status" = 30 |
janhartigan
commented
Mar 18, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment