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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql and multiple related rows issue

Author  Topic 

kieran5405
Yak Posting Veteran

96 Posts

Posted - 2007-11-21 : 11:50:38
Hi,

Each row in the table 'Application' can have multiple related rows in the 'Comments' table.

SELECT d.Address, Comments.comment
FROM Application as d
Left Join Comments on d.ID = Comments.DevID
where d.ID = 39

In the above example, when I run the query on the application that has 2 comments related to it...I get 2 rows returned...which is how it should be. But I really need to just get 1 row and some how have the 2 comments appended together in this row. Is this in anyway possible through some sort of join etc...

Thanks for all help...


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-21 : 12:08:43
http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concatenation-which-method-is-best.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

kieran5405
Yak Posting Veteran

96 Posts

Posted - 2007-11-21 : 12:43:01
cheers...worked great...
Go to Top of Page
   

- Advertisement -