Skip to content

DIV

Return the integer quotient from the division of two DECIMAL values.

div(expr1, expr2)

where expr1 and expr2 are both DECIMAL values. The first value is divided by the second.

For example:

premdb=# create table divtest(c1 decimal(5,3));
CREATE TABLE
premdb=# insert into divtest values(99.9);
INSERT 0 1
premdb=# select c1, div(c1,33.3) from divtest;
   c1   | div 
--------+-----
 99.900 |   3
(1 row)

Parent topic:Mathematical Functions