-
Sql Group By Query with innerjoin
Hiii...
My sql Query is as follows:
select (COALESCE(Mst_Submission.UniqueNo + ',','') + COALESCE (Investigator.InvestigatorName + ',','')+ PROPOSAL_INVESTIGATOR.Type) from PROPOSAL_INVESTIGATOR INNER JOIN MST_SUBMISSION ON PROPOSAL_INVESTIGATOR.UniqueNo = MST_SUBMISSION.UniqueNo INNER JOIN Investigator ON PROPOSAL_INVESTIGATOR.InvestigatorID = Investigator.Id where MST_SUBMISSION .UniqueNo ='11220'
The output for this query is :
11220,Sajjad Ur Rahman *,Principal Investigator
11220,Sufwan Alomar,Co-Investigator
11220,Hilal Al Rifai,Principal Investigator
11220,Rawia A. Jarir *,Co-Investigator
11220,Ahmed Masoud *,Principal Investigator
11220,Samer Taha *,Co-Investigator
11220,Ashraf Mansour,Co-Investigator
11220,Mohamad Adnan Mahmah * ,Co-Investigator
11220,Moaz Soliman,Co-Investigator
could any one help me to use Group By clause for making this output as :
11220, Sajjad Ur Rahman *,Principal Investigator,Sufwan Alomar,Co-Investigator,Hilal Al Rifai,Principal Investigator,Rawia A. Jarir *,Co-Investigator,Ahmed Masoud *,Principal Investigator,Samer Taha *,Co-Investigator,Ashraf Mansour,Co-Investigator,Mohamad Adnan Mahmah * ,Co-Investigator,Moaz Soliman,Co-Investigator
All your help is highly appreciated
-
It's not group by can do, take look at pivot instead.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|