Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 sql and multiple related rows issue
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kieran5405
Yak Posting Veteran

Ireland
96 Posts

Posted - 11/21/2007 :  11:50:38  Show Profile  Reply with Quote
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...



Edited by - kieran5405 on 11/21/2007 11:52:16

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 11/21/2007 :  12:08:43  Show Profile  Reply with Quote
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
Time is always against us

Go to Top of Page

kieran5405
Yak Posting Veteran

Ireland
96 Posts

Posted - 11/21/2007 :  12:43:01  Show Profile  Reply with Quote
cheers...worked great...
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000