Try reading this:
Simple Way To Use Pivot In SQL Query[
^]
By the way it is only urgent to you, not us and it's a lot easier to help people who post the code they are having a problem with
[EDIT]
It is not clear from your question whether you are trying to transform from a single row to many or from many rows to a single row. This is why I asked to see your query as it would have helped me to understand your question better.
However, here are some simple examples that you could use to fix your problem...
1. You have a table with many rows and you want a single row from it.
CREATE TABLE #demo1 ( c varchar(10), f float )
insert into #demo1 (c,f) values
('Col1' ,6.05),('Col2' ,7.15),
('Col3' ,9.5 ),('Col4' ,8.5 ),('Col5' ,6.5)
Use PIVOT...
SELECT * FROM
(SELECT c, f FROM #demo1) as s
PIVOT (MAX(f) FOR c IN (Col1,Col2,Col3,Col4,Col5)) AS p
Results:
6.05 7.15 9.5 8.5 6.5
2. You have a table with a single row and you want multiple rows from it.
CREATE TABLE #demo2
(
letter varchar(1),
Col1 float,
Col2 float,
Col3 float,
Col4 float,
Col5 float
)
insert into #demo2 (letter, Col1,Col2,Col3,Col4,Col5) values
('A',6.05, 7.15, 9.5, 8.5, 6.5)
There are two methods you can use
a) "Brute force"
SELECT 'Col1' AS [Column], Col1 FROM #demo2
UNION
SELECT 'Col2' AS [Column], Col2 FROM #demo2
UNION
SELECT 'Col3' AS [Column], Col3 FROM #demo2
UNION
SELECT 'Col4' AS [Column], Col4 FROM #demo2
UNION
SELECT 'Col5' AS [Column], Col5 FROM #demo2
ORDER BY [Column]
or b) UNPIVOT
SELECT c, f FROM
(SELECT Col1,Col2,Col3,Col4,Col5 FROM #demo2 ) s
UNPIVOT
(f FOR c IN (Col1,Col2,Col3,Col4,Col5)) AS upvt
ORDER BY c
Both give the same result
Col1 6.05
Col2 7.15
Col3 9.5
Col4 8.5
Col5 6.5