Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Thu, 10 Apr 2008 @ 14:47:09 GMT


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


Subj:   Re: Query to identify the Decimal
 
From:   Dieter Noeth

Satyamadhav Vangara wrote:

  I am having a table with one of the column data type as Decimal() .  


  So I need a sql query that would cast decimal column to float if the data is not equal to zero and fails if the input data is zero.  


  Exactly : case when col.id <>0.0 then cast(col.id as float) else failure.  


case when col.id <>0.0 then cast(col.id as float) else 1/col.id 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: 28 Jun 2020