Have this table (top row is column names):
security quote_type price
sec_1 bid 3.4
sec_1 ask 3.6
sec_2 bid 5.2
sec_2 ask 5.4
sec_3 bid 2.3
sec_4 ask 7.8
Need a query to achieve these results:
security bid ask
sec_1 3.4 3.6
sec_2 5.2 5.4
sec_3 2.3 null
sec_4 null 7.8
Using SQL Server.
Thanks for any help!
bid,askper security you can use conditional aggregation to get the expected result. You can find plenty of similar cases here in SO.