Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need SQL Query - oracle 8i

SuriMay 3 2012 — edited May 7 2012
Hi,

We are using Oracle 8i (Oracle8i Enterprise Edition Release *8.1.7.4.0 - 64bit Production*).

My requirement is -

I need output like

USER_NAME Company

Suri 01,86,65
Srinu 01,86,65


Here is the sample data.
WITH t AS ( SELECT 'SURI' user_name ,'01' Company FROM dual UNION ALL
            SELECT 'SURI' user_name, '86' Company FROM dual UNION ALL
            SELECT 'SURI' user_name ,'65' Company FROM dual UNION ALL
            SELECT 'SRINU' user_name, '01' Company FROM dual UNION ALL
            SELECT 'SRINU' user_name ,'86' Company FROM dual UNION ALL
            SELECT 'SRINU' user_name ,'65' Company FROM dual )
SELECT * FROM t ;


USER_NAME	COMPANY
SURI	         01
SURI	         86
SURI	         65
SRINU	         01
SRINU	         86
SRINU	         65
Many thanks in advance for the help.

Thanks,
Suri
This post has been answered by Frank Kulash on May 4 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2012
Added on May 3 2012
9 comments
316 views