You are here:

Oracle/Oracle (No of Rows Into Single row)

Advertisement


Question
In Oracle I want to select No of rows into Single Row.
For example (In the huge records)
Name Address contact-no
N1    A1       123
N2    A2       456
N3    A3       678

Output I want to print

Name Address contact-no
N1    A1       123        N2    A2       456   N3    A3       678

How get the above output using pivot or any other way?
Thanks in advance

Answer
Hi Prakash,

There are multiple ways to get this result. The possible ways are listed at this site -

http://www.dba-oracle.com/t_display_multiple_column_values_same_rows.htm

You can use the stragg user defined function as described at the following link (Custome aggregate functions) -

http://www.oratechinfo.co.uk/delimited_lists_to_collections.html

Hope this helps.

Regards

Suchitra  

Oracle

All Answers


Answers by Expert:


Ask Experts

Volunteer


Suchitra Joshi

Expertise

I can answer questions regarding SQL, PL/SQL, Procedures, Functions, Triggers, SQL Loader, Oracle Forms, Oracle Reports, and some basic dba and performance tuning activities.

Experience

15+ years of Oracle PL/SQL Development

Education/Credentials
B.Sc (Electronics), Diploma in Computer Applications (DCA)

Awards and Honors
Oracle PL/SQL Developer Certified Associate (OCA)
Oracle Database: SQL Certified Expert
Brainbench certifications in Oracle Administration, PL/SQL, Developer 2000

©2012 About.com, a part of The New York Times Company. All rights reserved.