RE: combine column?
Posted in 1999
yes there is an excellent way of doing this. First of all you need to use the concatenation operator to combine the two columns E.g. select col_a || col_b from table_name where ...... this will combine the tow columns together. However the first column will retain the trailing spaces. To get rid of these spaces so that column b appears right after column a then you should use the TRIM function. The syntax is something like: select TRIM(TRAILING col_a)||col_b from table_name WHERE .... This only applies to V7.2 I think. If I'm wrong I'm sure somebody will correct me. If you do not have V7 then I think you can only do this in a 4GL. Many Regards Rekaish > -----Original Message----- > From: Yan Zhu [SMTP:yan.zhu@infinity-insurance.com] > Sent: Friday, February 05, 1999 2:12 PM > To: informix-list@iiug.org > Subject: combine column? > > > hi all: > is there anyway to combine text fileds in a select statement? > say i have a,b as fields in my table, what would be the sql to > output one column whose content is the combination of a and b. If the > value in field a is "informix", and the value in b is "iscool", I want > my output to be "informixiscool". possible? > thanks > yan >