On 11/16/2011 12:26 PM, Johann Schatzer wrote:
> How can I ~truncate~ integers?
>
>
> this column
>
> 4770
> ...
>
> should give
>
> 4700
> ...
>
> thank you
Oh, you can also use the behavior of integer math:
select (4770/100)*100;
?column?
----------
4700
If you have negative numbers, you need to determine how they should be
truncated. The two methods will behave differently:
select (-4770/100)*100;
?column?
----------
-4700
select floor(-4770*.01)*100;
?column?
----------
-4800
Cheers,
Steve