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 2008 Forums
 Transact-SQL (2008)
 Hlep needed with SQL Query

Author  Topic 

ashoky2k_99
Starting Member

2 Posts

Posted - 2012-01-19 : 16:24:02
Hi All,
I was wondering if you would be able to help me with a simple query.

Here is a table with two fields:

Name ParentName
1234 1234xy
1234 ab1234

I would like write a query in SQL Server that yields results like following:

1234 1234xy ab1234

How do I do this? If you could write a query and send me, I would really appreciate.

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-19 : 16:44:41
what if you had 100 names of 1234?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

ashoky2k_99
Starting Member

2 Posts

Posted - 2012-01-19 : 16:53:06
@X002548
want concatenate all 100 of them, if i have some more rows with diffrent ID, I want to concatenate them too sepearte

Thanks in advance
Go to Top of Page

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2012-01-19 : 17:06:51
Hello ashoky2k_99,

Perhaps the following thread will help stimulate some ideas:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53293

HTH.
Go to Top of Page
   

- Advertisement -