a very primitive question about division

From: Martin Mueller <martinmueller(at)northwestern(dot)edu>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: a very primitive question about division
Date: 2018-03-07 17:21:12
Message-ID: 411898BB-F429-4654-88B6-F172185DB096@northwestern.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a very primitive question about division to which I can’t find an obvious answer in the documentation.

Given two values defined as integers, how do I divide one by the other and get an answer with two decimals, e.g 3 /4 = 0.75.

This is very simple in mysql and seems to be oddly contorted in postgres. I spent half an hour on the Web and with the documentation but couldn’t find a simple example.

Probably my stupidity.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-03-07 17:23:28 Re: a very primitive question about division
Previous Message Alvaro Herrera 2018-03-07 16:39:26 Re: Help troubleshooting SubtransControlLock problems