Thomas Good <tomg@nrnet.org> writes:
> On Mon, 12 Jul 1999, Tom Lane wrote:
>> Pretty much just like that. What problem are you having?
> The divison rtns 0, which multiplied by 100, rtns 0.
If your data is stored as int fields, then you'd get integer division,
which sounds like what you're getting. You want a floating-point
division, which you'd get by promoting to float:
SELECT (current_value::float8/target::float8) * 100;
regards, tom lane