Created
July 27, 2017 08:11
-
-
Save AlphaWong/32ed6ca27a8d6ee82305ea83e75f68c3 to your computer and use it in GitHub Desktop.
join.sql
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 * FROM vanorderspecialrequest as a right join th_vanlookupspecialrequests as b on a.idvanspecialrequest = b.id where b.enable = 1; | |
SELECT * FROM vanorderspecialrequest as a left join th_vanlookupspecialrequests as b on a.idvanspecialrequest = b.id where b.enable = 1; | |
# A table (Master) vs B table (non-master) | |
# A table (1,2,3,4,5) | |
# b table ({orderId:1,user:'alpha'},{order:2,user:'beta'}) | |
# if A join B will not deduct the total result | |
# if B join A will deduct total result | |
# SQL performance groups by two section | |
# 1. sql caculation and | |
# 2. total response result. | |
# Importance need to clear the mysql cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment