MySQL Forums
Forum List  »  General

PRoblem to get All the join table row in one column
Posted by: Amit Patel
Date: February 09, 2009 01:00PM

Hello,

I want to get the record of multiple row in one column.

Here is a scenario,

Table : Person
Fields : id , name , age

Table : image
Fields : id , personId , imagename


Dummy Records :
Person
ID Name age
1 AAA 30
2 BBB 28
3 CCC 34
4 DDD 26

Image
Id PersonID ImageName
1 1 1.jpg
2 1 2.jpg
3 1 3.jpg
4 2 4.jpg
5 2 5.jpg


I want to get All the Persons record and (image related to that person in one column) :
ID Name age ImageID
1 AAA 30 1,2,3
2 BBB 28 4,5
3 CCC 34
4 DDD 26

I can not get the above result.. Do any one can Help me to get the below o/p for the Person & Image Class ?



Edited 1 time(s). Last edit at 02/09/2009 01:52PM by Amit Patel.

Options: ReplyQuote


Subject
Written By
Posted
PRoblem to get All the join table row in one column
February 09, 2009 01:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.