Prepare for your Next Interview
This is a discussion on Rows to columns and vice-versa within the Data Warehousing forums, part of the Databases category; How can you transpose rows to columns and vice versa and what transformations would you choose? Pls explain how to do the mapping.....
|
|||
|
Re: Rows to columns and vice-versa
Hi,
src table: eno colname colval ------------------- 1000 name prakash 1000 age 24 1000 sal 25000 1001 name srini 1001 age 21 1001 sal 25000 output: eno name age sal ------------------ 1000 prakash 24 25000 1001 srini 21 25000 logic: src-------->agg---------->tar in agg: step 1: create the o/p port, for getting the name of the employee o_name iif(colname='name',colval) step 2: create the o/p port, for getting the age of the employee o_name iif(colname='age',colval) step 3: create the o/p port, for getting the sal of the employee o_name iif(colname='sal',colval) step 4: please enable group by option for the employee number. Please get back to us in case of queries. Thx, prakash ![]() |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Identify Rows columns in datagrid control | kanta | QTP | 8 | 07-31-2008 05:11 PM |
| Set columns as not null | jency | SQL | 2 | 12-06-2007 01:12 AM |
| Pivot columns | Sant_parkash | Oracle | 3 | 10-24-2007 10:35 AM |
| How to convert rows into columns in Teradata | rashnyo | Data Warehousing | 0 | 07-12-2007 01:52 AM |
| How do I transpose Rows into Columns? | Anasuya1031 | SQL | 2 | 07-09-2007 05:37 AM |