Ask a Question
Advertise on boostr.in
how to get multiple records against one record based on relation
how to get multiple records against one record based on relation ¬†using -'mysql,sql,database'
I have two tables Organisation and Employee having one to many relation i.e one organisation can have multiple employees. Now I want to select all information of a particular organisation plus first name of all employees for this organisation. What‚Äôs the best way to do it? Can I get all of this in single record set or I will have to get multiple rows based on no. of employees? Here is a bit graphical demonstration of what I want:
Org_ID ¬†¬†¬†¬†¬†Org_Address ¬†¬†¬†Org_OtherDetails ¬†¬†¬†Employess
1 ¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†132A B Road ¬†¬†¬†List of details ¬†¬†¬†¬†Emp1, Emp2, Emp3.....
Sep 22, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please