Created
November 11, 2012 15:24
-
-
Save abrkn/4055217 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 o,side, o.price, sum(o.volume) | |
FROM active_order o | |
WHERE o.side = 0 | |
GROUP BY o.price, o.side | |
ORDER BY o.price DESC | |
LIMIT 50 | |
UNION ALL | |
SELECT o.side, o.price, sum(o.volume) | |
FROM active_order o | |
WHERE o.side = 1 | |
GROUP BY o.price, o.side | |
ORDER BY o.price ASC | |
LIMIT 50; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment