Archives of the TeradataForum
Message Posted: Wed, 17 Sep 2003 @ 18:41:33 GMT
Subj: | | Re: GREATEST of N numbers |
|
From: | | Jeremy Christiansen |
If you are pre-V2R5 then the probably the best way to do this is with a case statement:
Case when field_a > field_b and field_a > field_c and field a > field_d
then field_a
when field_b > field_c and field b > field_d
then field_b
when field_c > field_d
then field_c
else field_d
end
This is surely not the sleek, simple solution you were looking for, but without user-defined functions (and any predefined function that
does what you want), I think this is the easiest approach.
|