PCHomepage
Programmer
I see lots of posting here and elsewhere about pivoting but nothing that seems to work for me. I have a rather convoluted query that pulls up a short set of data as a column but I need it to be a row. If needed, Column1 contains "column" names. Any ideas or is there a stored procedure there to do it?
Code:
SELECT Column2 FROM `test_table`
WHERE Column1 NOT IN (SELECT Column1 FROM `test_table`
WHERE (Column1 <= '@' OR Column1 >= '{'))
AND Column1 NOT IN (SELECT Column1 FROM `test_table`
WHERE Column1 LIKE '%a_param%')
AND Column1 != ''
AND Column1 != 'Keyword'
AND Column1 != 'Name'
AND Column1 NOT LIKE 'D%'