Last active
August 29, 2015 13:57
-
-
Save tdowling/9666572 to your computer and use it in GitHub Desktop.
option transactions on the same day
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 aa1.activity, | |
| aa2.activity, | |
| aa1.date, | |
| aa1.account_id | |
| FROM account_activities aa1 | |
| RIGHT JOIN account_activities aa2 ON aa1.account_id = aa2.account_id | |
| AND aa1.date = aa2.date | |
| AND aa1.fund_id = aa2.fund_id | |
| AND aa1.activity <> aa2.activity | |
| JOIN funds f ON aa1.fund_id = f.id | |
| WHERE f.symbol LIKE '%|%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment