PostgreSQL needs percentage function

From: Nick Dro <postgresql(at)walla(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: PostgreSQL needs percentage function
Date: 2017-12-18 12:23:38
Message-ID: ^75EF6A639D2C0E83BEC677FB95E668672BBAB816@walla.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<div dir='rtl'><div dir="ltr">Hi,</div>
<div dir="ltr">Why PostgreSQL doesn't have build-in function to calculate percentage? somthing like percent(number,%</div>
<div dir="ltr">for example:</div>
<div dir="ltr">select percent(100,1) will calculate 1% of 100 = 1</div>
<div dir="ltr">select percent(25,20) will calculate 20% of 25 = 5</div>
<div dir="ltr">&nbsp;</div>
<div dir="ltr">Seems like a nice addition to the math functions list:</div>
<div dir="ltr">https://www.postgresql.org/docs/9.5/static/functions-math.html</div>
<div dir="ltr">&nbsp;</div>
<div dir="ltr">This is veryhelpull function, many uses percentage calculation in thier work and it will simplify the process. Percentage calculation is considered a basic math operation and I think postgresql should support it as a build-in function.</div>
<div dir="ltr">Seems like easy to implment isn't it?</div></div>

Attachment Content-Type Size
unknown_filename text/html 881 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Achilleas Mantzios 2017-12-18 12:29:56 Re: PostgreSQL needs percentage function
Previous Message Yogesh Sharma 2017-12-18 10:02:43 Re: Size of pg_multixact/members increases 11355