Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 17 Sep 2003 @ 18:41:33 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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.



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023