I am required to convert columns of a table into rows ways. After spending sometime I found, it can be done by using pivot
clause. But I didn't understand the concept, the working of pivot
operators even after going through many articles,documents which they say simple but hard for me to understand. So can anyone help me understand the basics of pivot using the tables? consider the below tables to answer
--------------
|name |value|
|------|-----|
|rate1 |145 |
|rate2 |150 |
|rate3 |155 |
--------------
now I want the result as
-------------------
|rate1|rate2|rate3|
|-----|-----|-----|
|145 |150 |155 |
-------------------
else I just want only one column converted. okay simple table with one column as shown below
-------
|value|
|145 |
|150 |
|155 |
-------
now the result should be like
----------------
|hdr1|hdr2|hdr3|
|----|----|----|
|145 |150 |155 |
----------------
Note:The headers doesn't matter, it can be anything for the resulting table. now anyone please help me how to achieve this.Explanations will be highly appreciated.