pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: "D'Arcy" "J.M." Cain <darcy@druid.net>
To: tomg@nrnet.org
Cc: tgl@sss.pgh.pa.us
Cc: tomg@admin.nrnet.org
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] calculating percentages
Date: Tue, 13 Jul 1999 08:52:49 -0400 (EDT)
Message-ID: <m11423F-0000bFC@druid.net> (raw)
In-Reply-To: <Pine.LNX.3.96.990712104853.16755A-100000@mailhost.nrnet.org>

Thus spake Thomas Good
> > > How does one do this:   SELECT (current_value/target) * 100;
> The divison rtns 0, which multiplied by 100, rtns 0.

Does "SELECT (current_value * 100)/target" work better?

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.



view thread (13+ messages)  latest in thread

Message-ID: <m11423F-0000bFC@druid.net>
Permalink:  ../m11423F-0000bFC@druid.net/
Also on:    postgresql.org/message-id/m11423F-0000bFC@druid.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, tomg@nrnet.org, tgl@sss.pgh.pa.us, tomg@admin.nrnet.org
  Subject: Re: [SQL] calculating percentages
  In-Reply-To: <m11423F-0000bFC@druid.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox