Last active
December 29, 2016 08:06
-
-
Save joynal/a3238bcd2214913f2ac38de2e07fc95d 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 | |
a2, b2, c2 | |
FROM | |
A | |
INNER JOIN | |
B ON B.a_id = A.id AND B.b1 = "Y" | |
INNER JOIN | |
C ON C.b_id = B.id AND C.c1 = "Z" | |
WHERE A.a1 = 'X'; | |
// Experimendted on sample database [http://www.mysqltutorial.org/download/2] | |
SELECT | |
jobTitle, customerName, orderNumber, orderDate | |
FROM | |
employees E | |
INNER JOIN | |
customers C ON E.employeeNumber = C.salesRepEmployeeNumber AND C.customerName = "Technics Stores Inc." | |
INNER JOIN | |
orders O ON C.customerNumber = O.customerNumber | |
WHERE E.jobTitle = "Sales Rep"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment