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)
 concatenation query

Author  Topic 

Mike_h
Starting Member

7 Posts

Posted - 2009-05-29 : 08:55:39
Hi.

I have a table that contains the followin

Num1 Num2
2906 P11
2905 P11
2912 P22

i would like to write a query to output the following result

num1 num2
2906/2905 P11
2912 P22

Can anyway give me an idea of how to return this.

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-29 : 08:58:07
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


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

Go to Top of Page

eralper
Yak Posting Veteran

66 Posts

Posted - 2009-06-08 : 09:43:44
One more link with sql sample codes on string concatenation using XML PATH() at [url]http://www.kodyaz.com/articles/concatenate-using-xml-path.aspx[/url]

I hope you find helpful.
I like using the for XML PATH() method, because I found it fascinating.


-------------
Eralper
http://www.kodyaz.com
Go to Top of Page
   

- Advertisement -