SQL question: how to concat two different data type fileds into one ?

cywong119

New Member
Help please!

Could anyone advise me how to concatenate two fields into one in progress SQL?
My SQL statement is as follows:

select pub.tableA.fieldA || pub.tableA.fieldB from pub.tableA

pub.tableA.fieldA is character type
pub.tableA.fieldB is integer type

Of course this SQL statement doesnot work since the data type of fieldA and fieldB are different .

Could anyone advise me?

Christine
 

StefGay

Member
Hi,

select pub.tableA.fieldA || to_char(pub.tableA.fieldB) from pub.tableA

You can see all the options for the to_char function in the electronic documentation.

Hope it helps.

Stéphane.
 
Top