Converting rows into columns (PIVOT for string values)
-
I have a small problem. I need to convert some rows into columns. Look at the following information. Original Table: Ind Sub String 0 1 22 0 2 21 0 3 5.6 0 4 John Rogers 1 1 12 1 2 76 1 3 99.3 1 4 Sarah Peters Converted to: Ind val1 val2 val3 val4 0 22 21 5.6 John Rogers 1 12 76 99.3 Sarah Peters This is similar to a pivot, except that I am not count, averaging, counting, or any other agregating methods. Is there a simple query that will convert this or is this going to be a cursor issue?
Leo T. Smith Program/Analyst Supervisor
-
I have a small problem. I need to convert some rows into columns. Look at the following information. Original Table: Ind Sub String 0 1 22 0 2 21 0 3 5.6 0 4 John Rogers 1 1 12 1 2 76 1 3 99.3 1 4 Sarah Peters Converted to: Ind val1 val2 val3 val4 0 22 21 5.6 John Rogers 1 12 76 99.3 Sarah Peters This is similar to a pivot, except that I am not count, averaging, counting, or any other agregating methods. Is there a simple query that will convert this or is this going to be a cursor issue?
Leo T. Smith Program/Analyst Supervisor