Connecting Tech Pros Worldwide Forums | Help | Site Map

Rowset string concatenation

Newbie
 
Join Date: Jan 2008
Posts: 4
#1: Jan 21 '08
I have a table with the following information
Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE TEST2 (ID1 INT, NAM1 VARCHAR (20), PLANT VARCHAR (20))
  2. INSERT INTO TEST2 VALUES(1,'AA1','P1')
  3. INSERT INTO TEST2 VALUES(1,'AA1','P2')
  4. INSERT INTO TEST2 VALUES(1,'AA1','P3')
  5. INSERT INTO TEST2 VALUES(1,'AA1','P4')
  6. INSERT INTO TEST2 VALUES(1,'AA1','P5')
  7. INSERT INTO TEST2 VALUES(2,'AA2','P6')
  8. INSERT INTO TEST2 VALUES(2,'AA2','P2')
can anybody help me out to get the result set like this:
Expand|Select|Wrap|Line Numbers
  1. ID1     NAME1       PLANTS
  2. ---     ------      -------------------
  3. 1          AA1      P1, P2, P3, P4, P5
  4. 2          AA2      P1, P2
  5.  
thanks in advance

sakumar9's Avatar
Expert
 
Join Date: Jan 2008
Location: Bangalore
Posts: 127
#2: Feb 11 '08

re: Rowset string concatenation


This is not possible with SQL. You can have this kind of output generated with your application.

Regards
--- Sanjay
Reply