我已经尝试了一段时间来解决这个问题,但是我缺乏更高级的 SQL 技能使我退缩了。
Executions(TradeDate, Symbol, Side, Price, Under, Account)
TEMP DATA:
2012-06-20, AAPL 120716C00600000, BUY, 3.25, AAPL, XYZ123
2012-06-20, AAPL 120716C00600000, SELL, 3.30, AAPL, XYZ123
2012-06-20, AAPL 120716C00600000, BUY, 3.25, AAPL, XYZ123
2012-06-20, AAPL 120716C00600000, SELL, 3.30, AAPL, XYZ123
2012-06-20, GRPN 120716C00027000, BUY, 2.25, GRPN, XYZ123
2012-06-20, GRPN 120716C00027000, SELL, 2.30, GRPN, XYZ123
2012-06-20, GRPN 120716C00027000, SELL, 2.30, GRPN, XYZ123
2012-06-20, GRPN 120716C00027000, BUY, 2.25, GRPN, XYZ123
-UNDER----Side(Buy)----Side(Sell)
AAPL 6.50 6.60
GRPN 4.50 4.60
如您所见,我正在尝试获取每边的价格总和,然后按下分组。