Last active
April 24, 2017 07:42
-
-
Save tlkshadow/e9bac12e91ac48f21054d44e05925615 to your computer and use it in GitHub Desktop.
Bad example
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.id | |
b.name, | |
s.name, | |
s.address, | |
max(ap.price) as newest_price, | |
wm.quantity | |
#— …. | |
FROM article a | |
JOIN brand b on a.brand_id = b.id | |
LEFT JOIN supplier s ON s.id = a.supplier_id | |
LEFT JOIN article_price ap ON ap.article_id = a.id | |
GROUP BY a.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment