Subject RE: [firebird-support] How To Concatinate Multiple Rows Data Into Single One
Author Svein Erling Tysvær
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