Question : concat 2 columns in a select

In a table with 2 columns (A and B) there is one row of data.  A contains 'aaa' and B contains 'bbb'.  How do I select both columns such that the data is concatinated: 'aaabbb'

Correct this syntax:
select a + b from thetable

thanks

Answer : concat 2 columns in a select

I assume you have somethig like this:

create table Test (A char(4),B char(4))
insert into Test values ('aaa','bbb')

You may get the result using this query:

select LTRIM(RTRIM(A)) + LTRIM(RTRIM(B)) from Test

Does it work?
Note that the query you posted is correct.


Random Solutions  
 
programming4us programming4us