Can we use a sql data field as column name instead?
- by Starx
First a query
SELECT * FROM mytable WHERE id='1'
Gives me a certain number of rows For example
id | context | cat | value
1 Context 1 1 value 1
1 Context 2 1 value 2
1 Context 1 2 value 3
1 Context 2 2 value 4
Now my problem instead of receiving the result in such way
I want it is this way instead
id | cat | Context 1 | Context 2
1 1 value 1 value 2
1 2 value 3 value 4