Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL informix : How to join 2 fields in <> format:string with smallint?

Status
Not open for further replies.
Dec 14, 2005
1
FR
I have to join 2 fields in a select query with 2 differents format : string (valchar) and smallint ?

How can I manage it ?

I want to use the result field as a smallint .
 
create temp table x (x1 char, x2 varchar(2));
insert into x values ('A','5');

create temp table y (y1 char, y2 smallint);
insert into y values ('A', 3);

--joining 2 fields
select trim(x2)||y2 from x,y where x1=y1;
--adding 2 fields
select trim(x2)+y2 from x,y where x1=y1;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top