Home » SQL & PL/SQL » SQL & PL/SQL » concatenate result strings (Oracle 9i, Window)
concatenate result strings [message #430325] Tue, 10 November 2009 01:51 Go to next message
panchpan
Messages: 34
Registered: October 2007
Member
Hello.

I have a table emp with columns empid, empskill as below:
empid empskill
------------------------
1 s1
1 s2
1 s3
2 s1
2 s2

I ran a query:
select empskill from emp where empid = '1';
got results in below format:

s1
s2
s3

How can i modify the query to have the result displayed in below concatenated format:

s1s2s3

Thank you
Re: concatenate result strings [message #430327 is a reply to message #430325] Tue, 10 November 2009 01:57 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Search with in this forum for String Aggregation.


Or follow the link...http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

sriram.
Re: concatenate result strings [message #430335 is a reply to message #430325] Tue, 10 November 2009 02:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Also search for "PIVOT", this question is asked every week.

Regards
Michel
Re: concatenate result strings [message #430346 is a reply to message #430335] Tue, 10 November 2009 03:02 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Michel Cadot wrote on Tue, 10 November 2009 02:31
Also search for "PIVOT", this question is asked every week.

Regards
Michel


Michel does PIVOT Work for this Oracle 9i version


regards
sriram
Re: concatenate result strings [message #430348 is a reply to message #430346] Tue, 10 November 2009 03:08 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
ramoradba wrote on Tue, 10 November 2009 10:02
Michel Cadot wrote on Tue, 10 November 2009 02:31
Also search for "PIVOT", this question is asked every week.

Regards
Michel


Michel does PIVOT Work for this Oracle 9i version


regards
sriram

Pivoting is a technique, not a predefined function.
Re: concatenate result strings [message #430379 is a reply to message #430348] Tue, 10 November 2009 04:35 Go to previous message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Frank wrote on Tue, 10 November 2009 03:08
ramoradba wrote on Tue, 10 November 2009 10:02
Michel Cadot wrote on Tue, 10 November 2009 02:31
Also search for "PIVOT", this question is asked every week.

Regards
Michel


Michel does PIVOT Work for this Oracle 9i version


regards
sriram

Pivoting is a technique, not a predefined function.


Frank,
thanks for your reply ...In 11g its an operator.
i know that "Traditional pivoting is done with DECODE and CASE ".

Sriram.
Previous Topic: put results of dynamic sql into pl/sql statements
Next Topic: ORA-01848
Goto Forum:
  


Current Time: Sat Dec 03 08:16:36 CST 2016

Total time taken to generate the page: 0.21418 seconds