Re: Characteristic functions with Informix?
Posted in 1998
In article <353E7AFF.5D7F@weblogic.com>,
Joe Weinstein <joe@weblogic.com> wrote:
>select
> 'Column one is '
> || ((col1 > col2) 'bigger' : 'smaller')
> || ' than column two' from myIntTable;
>
>yielding
>
>'Column one is bigger than column two'
>'Column one is smaller than column two'
>... etc
>
I don't know if this would qualify as a solution for you, but:-
create temp table t1 ( col1 smallint, col2 smallint ) with no log ;
insert into t1 values ( 1,2 ) ;
insert into t1 values ( 2,1 ) ;
insert into t1 values ( 3,4 ) ;
insert into t1 values ( 4,2 ) ;
select col1, col2, " column one is larger than column 2"
from t1
where col1 > col2
union
select col1, col2, " column one is smaller than column 2"
from t1
where col1 < col2
yields:-
col1 col2 (constant)
1 2 column one is smaller than column 2
2 1 column one is larger than column 2
3 4 column one is smaller than column 2
4 2 column one is larger than column 2
4 row(s) retrieved.
Any use?
- Paul, who *highly* recommends "The Kingdom" by Lars Von Trier,
available on video is the US and probably elsewhere. Best thing
I have seen for a long long time.