Created
April 8, 2014 19:22
-
-
Save manlycode/10175442 to your computer and use it in GitHub Desktop.
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 DISTINCT(products.id), products.updated_at | |
FROM products | |
INNER JOIN lots | |
ON (lots.product_id = products.id) | |
GROUP BY products.id | |
HAVING SUM(lots.quantity) > 100; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment