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
 General SQL Server Forums
 New to SQL Server Programming
 Merge 2 fields

Author  Topic 

ojhawkins
Starting Member

4 Posts

Posted - 2012-03-22 : 04:29:54
Hi all,

Is there a way to "Merge" 2 fields into 1.

For example;

If I have two columns with string data that have 5 records in each.

I want to join so there is 1 field with 10 records.

Is this possible to do?

Any help is greatly appreciated.

Cheers,
O

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-03-22 : 04:35:37
[code]
select col1 + col2
from yourtable
[/code]


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

Go to Top of Page

ojhawkins
Starting Member

4 Posts

Posted - 2012-03-22 : 04:40:24
Thanks,

This Concatenated the strings still with 5 records.

Am I missing something?

Cheers,
O
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-03-22 : 04:44:28
oh i see what you want


select col1 from yourtable
union all
select col2 from yourtable



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

Go to Top of Page

deepaksahay.seo
Starting Member

1 Post

Posted - 2012-03-22 : 06:06:06
Nice! your informatin is really very unique and interesting . Thanks for sharing this news. You can better this time help of internet. Thank you.

Facebook Games To Play

Facebook Games Play

New Facebook Games

Go to Top of Page

ojhawkins
Starting Member

4 Posts

Posted - 2012-03-22 : 08:06:43
Perfect! Thanks khtan.

Deepaksahay ?? Spam ??
Go to Top of Page
   

- Advertisement -