Top 60 Oracle Blogs

Recent comments


Here’s a little trick I’ve only just discovered (by accident). What’s a tidy way to extract the fractional part from a number ?
Running (I haven’t checked earlier versions yet – or looked at the manuals for the definition of the mod() function):

SQL> select mod(1.34,1) from dual;


1 row selected.

SQL> select mod(-1.34,1) from dual;


I really didn’t think it would make sense to use an expression like mod(p,1) – but it’s pleasant surprise that is does what it does.