Hi Friends

I have a sql question, We have the source data as below.

101 address1, address2, address3

and the output shoulb like below

101 address1
101 address2
101 address3

Required a SQL query for this output.

Please let me know if you have any sql query for this.

Thanks in advance.

Hari M

Answer Posted / ksks

Make use of UNPIVOT to split one record into many rows:
select id,address from T1 unpivot (address for address_type in (address1,address2,address3))

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the components provided on node?

564


Which is faster fastload or multiload?

591


List out teradata data types?

553


What is the primary index in teradata?

577


What is upsert statement in teradata?

606






What is meant by a Clique?

580


what are the uses of fact table and dimension table in banking project?

4090


What is a node in teradata?

569


if collect stats but it show low confidence why?

1178


What are the uses of client software involved in teradata?

530


Explain the parallel data extension in teradata?

649


What are the frequently used data types in teradata?

588


What are the various indexes in teradata? How to use them?

555


What is logical data model?

630


During the Display time, how is the sequence generated by Teradata?

611