Geeks Talk

Prepare for your Next Interview




Rows to columns and vice-versa

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.....


Go Back   Geeks Talk > Databases > Data Warehousing

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-23-2008
Junior Member
 
Join Date: Mar 2008
Posts: 22
Thanks: 1
Thanked 2 Times in 2 Posts
tanya_j is on a distinguished road
Rows to columns and vice-versa

How can you transpose rows to columns and vice versa and what transformations would you choose?
Pls explain how to do the mapping..
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-25-2008
Contributing Member
 
Join Date: Dec 2007
Location: INDIA
Posts: 36
Thanks: 1
Thanked 6 Times in 6 Posts
cme_prak is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Databases > Data Warehousing


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 08:15 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved