Prev: Db2 going down frequently
Next: SQL stored procs
From: cbielins on 31 Aug 2009 13:59 What's going on here: select (11/5) as test from sysibm.sysdummy1 test == 2 I'm seeing my calculations round down to the nearest 1. I don't want that...
From: Ian on 31 Aug 2009 14:09 cbielins(a)gmail.com wrote: > What's going on here: > > select (11/5) as test from sysibm.sysdummy1 > > test == 2 > > > I'm seeing my calculations round down to the nearest 1. I don't want > that... DB2 uses strong typing. So, INTEGER / INTEGER = INTEGER. Try: 11.0 / 5 or cast(11 as decimal(5,0)) / 5
|
Pages: 1 Prev: Db2 going down frequently Next: SQL stored procs |