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 data from 2 columns

Author  Topic 

reading2009
Starting Member

22 Posts

Posted - 2011-09-30 : 12:02:35
Hi I have 2 columns:
col1 col2
1 null
2 3
null 5

result should be:
col3
1
2 3
5

how can i achieve this? any help?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-30 : 12:04:32
[code]
select coalesce(col1+ ' ','') + coalesce(col2,'') as col3 from table
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

reading2009
Starting Member

22 Posts

Posted - 2011-09-30 : 13:12:23
Thank you. It worked.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-30 : 13:18:26
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -