Subject RE: [firebird-support] How To Concatinate Multiple Rows Data Into Single One
Author Vishal Tiwari
Dear SET,
 
 
That SQL is working 100% as per the requirement.
 
 
Thank You Once Again. And Keep In Touch.
 
 
Enjoy!!!!!!!!!!!!
 
 
Have A Nice Day.
 
With Best Regards.
 
 
Vishal

--- On Wed, 1/9/10, Svein Erling Tysvær <svein.erling.tysvaer@...> wrote:


From: Svein Erling Tysvær <svein.erling.tysvaer@...>
Subject: RE: [firebird-support] How To Concatinate Multiple Rows Data Into Single One
To: "firebird-support@yahoogroups.com" <firebird-support@yahoogroups.com>
Date: Wednesday, 1 September, 2010, 1:57 PM


 



I would expect

SELECT Reader_Code, LIST(Book_Name)
FROM Reader_Books
GROUP BY 1

to work from Firebird 2.1 onwards.

HTH,
Set

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Vishal Tiwari
Sent: 1. september 2010 10:05
To: firebird-support@yahoogroups.com
Subject: [firebird-support] How To Concatinate Multiple Rows Data Into Single One

Hi All,
 
I have one requirement,  but before that let me explain the table structure:
 
I have a table say for example Books and it contains the books list as:
 
Table Name = Books
 
Book_Name
Book_A
Book_B
Book_C
 
I have another table Called Reader_Books, this would contain the no. of user taken those books for reading, table structure is as follows:
 
Table Name : Reader_Books
 
Reader_Code     Book_Name
R001                 Book_A
R001                 Book_B
R002                 Book_A
R002                 Book_B   
R002                 Book_C
R003                 Book_A
 
 
I need the data in following manner:
 
 
Reader_Code      Book_Name
R001                    Book_A
R002                    Book_A, Book_B, Book_C
R003                    Book_A
 
 
I tried my efforts but no result, but still I would like to learn how to achieve this.
 
I need to achieve above result only using SQL.
 
Thanks In Advance.
 
 
With Best Regards.
 
Vishal









[Non-text portions of this message have been removed]