Hi,
I’m having a problem using “select”, hope I could get some suggestions here.
========================================== what I have done so far =============================
my code :
price_series: select price by utc_datetime,sym from trade where sym in (ESH6;
efFESXH6), utc_datetime within (T0;T1)
the result :
utc_datetime sym | price
--------------------------------------| ------
2016.02.23D14:00:00.023522675 ESH6 | 193675
2016.02.23D14:00:00.045145057 ESH6 | 193700
2016.02.23D14:00:00.321368969 ESH6 | 193675
2016.02.23D14:00:00.565350502 ESH6 | 193700
2016.02.23D14:00:00.588827878 ESH6 | 193700
2016.02.23D14:00:00.862156420 efFESXH6| 29260
2016.02.23D14:00:00.923543870 efFESXH6| 29260
2016.02.23D14:00:01.190791741 ESH6 | 193675
2016.02.23D14:00:02.281757704 ESH6 | 193675
2016.02.23D14:00:02.351077832 efFESXH6| 29260
============================================ my question =================================
However, I want ESH6 and efFESXH6 to be displayed in separate columns, meanwhile the whole table is sorted by utc_datetime.
this is the desired result:
utc_datetime sym1 sym2 price
-------------------------------------------------------
2016.02.23D14:00:00.023522675 ESH6 193675
2016.02.23D14:00:00.045145057 ESH6 193700
2016.02.23D14:00:00.321368969 ESH6 193675
2016.02.23D14:00:00.565350502 ESH6 193700
2016.02.23D14:00:00.588827878 ESH6 193700
2016.02.23D14:00:00.862156420 efFESXH6 29260
2016.02.23D14:00:00.923543870 efFESXH6 29260
2016.02.23D14:00:01.190791741 ESH6 193675
2016.02.23D14:00:02.281757704 ESH6 193675
2016.02.23D14:00:02.351077832 efFESXH6 29260
As I formatted this table manually, I’m not sure which columns should be keyed. Could you please help me with it? Any suggestions are appreciated!!
Thanks,
Xinyu