Last active
March 3, 2017 11:57
-
-
Save calvez/40b05cecf4fd3dc23fd809548350e3b2 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 instr, SUM(qty*execprice+fee) FROM orders | |
| WHERE `stamp` >= '2017-02-27 09:03:00' | |
| #vagy | |
| #WHERE stamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| and | |
| status='filled' | |
| GROUP BY instr; | |
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 userid, count(userid) FROM orders | |
| WHERE stamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| and | |
| status='filled' | |
| GROUP BY userid; |
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
| #darabonként | |
| select instr, sum(qty) as total | |
| from orders | |
| WHERE stamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| GROUP BY instr, qty | |
| order by qty DESC; |
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 instr, SUM(qty) FROM orders | |
| WHERE stamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| and | |
| status='filled' | |
| GROUP BY instr; | |
| #OTP pl | |
| SELECT * FROM `orders` WHERE `instr` = 'otp' AND `status` = 'filled' AND `stamp` >= '2017-02-27 09:03:00' ORDER BY `stamp` DESC |
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 user_id, SUM(score) FROM betquiz.quiz_users | |
| WHERE date_submitted BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| GROUP BY user_id; |
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 userid, count(userid) FROM orders | |
| WHERE stamp BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| and | |
| status='filled' | |
| GROUP BY userid; |
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 user_id, SUM(score) FROM betquiz.quiz_users | |
| WHERE date_submitted BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| and | |
| score=3 | |
| GROUP BY user_id; |
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 user_id, SUM(score) FROM betquiz.quiz_users | |
| WHERE date_submitted BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE() | |
| and | |
| score=1 | |
| or | |
| score=2 | |
| GROUP BY user_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment