RE: Re: PostgreSQL needs percentage function

From: Nick Dro <postgresql(at)walla(dot)co(dot)il>
To: depesz(at)depesz(dot)com, pgsql-general(at)postgresql(dot)org
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: RE: Re: PostgreSQL needs percentage function
Date: 2017-12-18 16:13:58
Message-ID: ^FE34C70306C4621EEC5A3C105FA6EA1957DD7C46@walla.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<div><div dir="rtl"><div dir="ltr"><br>
<div dir="ltr">Hi,</div>
<div dir="ltr">I know how to implement this. It's not the issue.</div>
<div dir="ltr">It's very easy to implement absolute value as well yet still PostgreSQL gives <tt><code>abs(<tt>x</tt>)</code></tt> function which is build in function.</div>
<div dir="ltr">My claim is that if there is a build in function for absolute value why not for percentage? Both are very basic mathematical operations.</div>
<div dir="ltr">&nbsp;</div>
<div dir="ltr">Can you give a good reason why absolute value has a build in function while percentage is not?</div>
</div></div><section class="cust_msg_end"></section><blockquote style="margin:0;margin-bottom:20px;border-top:1px solid #e0e0e0;"><br>ב דצמ׳ 18, 2017 17:44, hubert depesz lubaczewski כתב:<blockquote style="margin:0;margin-bottom:20px;border-top:1px solid #e0e0e0">On Mon, Dec 18, 2017 at 02:23:38PM +0200, Nick Dro wrote:
<br>&gt; Hi,
<br>&gt; Why PostgreSQL doesn't have build-in function to calculate percentage?
<br>&gt; somthing like percent(number,%
<br>&gt; for example:
<br>&gt; select percent(100,1) will calculate 1% of 100 = 1
<br>&gt; select percent(25,20) will calculate 20% of 25 = 5
<br>What is the problem with using normal multiplication for this?
<br>depesz<br></blockquote></blockquote><br></div>

Attachment Content-Type Size
unknown_filename text/html 1.3 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Winkless 2017-12-18 16:17:45 Re: Re: PostgreSQL needs percentage function
Previous Message hubert depesz lubaczewski 2017-12-18 15:44:49 Re: PostgreSQL needs percentage function