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 |
mbelcher
Starting Member
1 Post |
Posted - 2014-04-06 : 22:47:17
|
I joined these two tables and it pulled up the proper amount of records. If you check out the image you will see what the results are for this query.Now all I need for this part would be to roll these up where I have one row per ProgramID and all the AttributeNames' together in a AttributeNames column for each id.EXAMPLE: All in one row.ProgramID | AttributeNames887 | Studydesign, Control Groups, Primary Outcomes.I have attached an image of the SQL VIEW that I need to modified so it does this. THE QUERY:SELECT TOP (100) PERCENT dbo.tblProgramAttributes.ProgramID, dbo.tblProgramAttributes.AttributeID AS PAattributeID, dbo.tblAttributes.AttributeID, dbo.tblAttributes.AttributeNameFROM dbo.tblProgramAttributes INNER JOINdbo.tblAttributes ON dbo.tblProgramAttributes.AttributeID = dbo.tblAttributes.AttributeIDWHERE (dbo.tblProgramAttributes.AttributeID NOT LIKE '%ProgramType%')ORDER BY dbo.tblProgramAttributes.ProgramID DESCThanks for all your help. |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-04-08 : 10:26:34
|
Could you please post some sample data and the expected results you are looking for? |
|
|
|
|
|