Re: PostgreSQL needs percentage function

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Nick Dro <postgresql(at)walla(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL needs percentage function
Date: 2017-12-18 15:44:49
Message-ID: 20171218154449.GA19797@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 18, 2017 at 02:23:38PM +0200, Nick Dro wrote:
> Hi,
> Why PostgreSQL doesn't have build-in function to calculate percentage?
> somthing like percent(number,%
> for example:
> select percent(100,1) will calculate 1% of 100 = 1
> select percent(25,20) will calculate 20% of 25 = 5

What is the problem with using normal multiplication for this?

depesz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nick Dro 2017-12-18 16:13:58 RE: Re: PostgreSQL needs percentage function
Previous Message David Steele 2017-12-18 14:20:47 Re: PgBackRest question?