Created
November 18, 2010 09:51
-
-
Save gamov/704819 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
## greatest n per group | |
SELECT * FROM shipping_items As t1 | |
WHERE t1.created_at = (SELECT Max(created_at) | |
FROM shipping_items As t2 | |
WHERE t2.item_variant_id = t1.item_variant_id | |
AND t2.item_variant_id in (11,10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment