 |
 |
Archives of the TeradataForum
Message Posted: Thu, 10 Apr 2008 @ 14:47:09 GMT
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
| |