Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 22 Jul 2003 @ 11:09:22 GMT


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


Subj:   Re: SELECT SIGN(-5) is not working in Teradata
 
From:   Dieter N�th

  I want to get the sign of the data,  


  In SQL SERVER  


  SELECT SIGN(-5) will return -1,
SELECT SIGN(5) will return +1,
SELECT SIGN(0) will return 0.
 


  Is any function like this available in Teradata?  



There's no similar function in Teradata, you have to calculate it yourself, e.g. using CASE:

case
when x < 0 then -1
when x = 0 then 0
else 1
end


Dieter



     
  <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