Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 29 Mar 2007 @ 11:13:34 GMT

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

Subj:   Re: Function for finding minimum among multiple values
From:   Mistry, Jeetendra


I am not sure of any functions as such, but if the number of columns are less, using case statements can solve the problem.

     select case
              when col1 < col2
              then (case when col1 < col3 then col1 else col3 end)
              else (case when col2 < col3 then col2 else col3 end)
     from table_nm;


  <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: 28 Jun 2020