Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 22 Jul 2003 @ 13:40:45 GMT


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


Subj:   Re: SELECT SIGN(-5) is not working in Teradata
 
From:   Dempsey, Mike

Rather than a CASE statement you could just use the ABS() function...if you know the value is never zero.

SELECT col1/ABS(col1)

will always give you -1 or +1

If the value might be zero you would need at least a simple CASE statement

SELECT CASE col1 WHEN 0 THEN 0 ELSE col1/ABS(col1) END

Mike Dempsey
Teradata Client Tools



     
  <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