I'm a bit rusty with SQL, I have one simple table
col1 col2 col3 col4
ident1 name1 data1 data3
ident2 name1 data8 data7
ident3 name1 data3 data8
...
ident1 name2 data4 data1
ident2 name2 data2 data5
ident3 name2 data6 data3
...
and I want to get several columns in this way
ident1 ident1 ident2 ident2 ident3 ident3 ...
name1 data1 data3 data8 data7 ...
name2 data4 data1 data2 data5 ...
name3 ....
...
Note this is not the same as MySQL: Returning multiple columns from an in-line subquery since I have just one table and I want to map the first column as the first row in the results.
I've read this is possible with subqueries like SELECT ... WHERE (col3,col4) IN (SELECT col3, col4 ...), but I'm gettin error like Unknown column col3 in 'IN/ALL/ANY subquery' and I can't figure out how to get the column names in the first row in the results and how to use group by to add columns. Any help?