October 31, 2002 at 8:54 am
Hi,
I am trying to concatenate/merge two columns into one. For example in my database table I have two columns A & B as follows
A B
James Bond
austin powers
I would like to join both of them in to a single column C as
C
James, Bonds
austin, powers
I tried using Union, but it returns C as
Jame
austin
bond
powers
Any help or pointers will be greatly appreciated.
thanks in advance for you help,
Vijju
October 31, 2002 at 8:57 am
select A + ', ' + B from TABLE
Regards,
Andy Jones
.
October 31, 2002 at 9:06 am
thank you Andy, that works like a charm.
October 31, 2002 at 10:52 am
Note however you may want to do ISNULL(A,'') + ISNULL(B,'') since if either columns is NULL then end results is NULL.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply