Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2007-06-29 : 14:42:05
|
| i need a sql select query. which brings data from master table and childtable.****************************************************************select master.projectname, master.documentdate, child.supervisorname from tblMasterProjectinfo master, tblProjSupervisors childwhere master.Projid = child.projid****************************************************************please i have multiple rows in the child table for each master record ID., how can i bind all of the rows supervisor name from child, into one piece of data comma seperated.can you please help, I am very confused.Thank you very much for the information. |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-06-29 : 14:53:14
|
| provide some sample data from each of the tables and expected output.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2007-06-29 : 15:08:32
|
| Hello Dinaker,Here is the Sample data i put, please help:***************************************************************************************************************Master table (tblMasterProjectInfo)projid - Projectname - documentdate 12 - School Board Project - 05/02/0715 - Liberty Communications - 06/01/07***************************************************************************************************************Now i am creating child records for (tblProjSupervisors)ProjSupervisorID - ProjID - Supervisorname - SupervisorEmail1 - 12 - Manuel Ruiz - mruiz@metabox.com 2 - 12 - Luis Alvarez - lalvarez@florida.com3 - 12 - Raj Kumar - rkumar@myflorida.com4 - 15 - Frank lache - flache@lacheweb.com5 - 15 - Mike Lee - mlee@stellar32.com****************************************************************************************************************Now when i execute the folowing query:****************************************************************select master.projectname, master.documentdate, child.supervisorname from tblMasterProjectinfo master, tblProjSupervisors childwhere master.Projid = child.projid****************************************************************i am expecting the data as follows:-----------------------------------------------------------------1.) School Board Project - 05/02/07 - Manuel Ruiz, Luis Alvarez, Raj Kumar2.) Liberty Communications - 06/01/07 - Frank Lache, Mike Lee**************************************************************************Thank you very much for the information/help. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
|
|
|
|
|
|
|