Unlimited Web Space

Enjoy Unlimited web hosting

Sep 28, 2011

How to join multiple columns in a single row?

We have Table(T1) as



C1    C2
a    1
b    2
c    3
d    4

Write the following sql query

select isnull(C1,'')+' , '+isnull(C2,'') as C1C2 from T1

This will give the result as
C1C2
a,1
b,2
c,3
d,4

No comments:

Post a Comment