Search Postgresql Archives

RE: Re: PostgreSQL needs percentage function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,
I know how to implement this. It's not the issue.
It's very easy to implement absolute value as well yet still PostgreSQL gives abs(x) function which is build in function.
My claim is that if there is a build in function for absolute value why not for percentage? Both are very basic mathematical operations.
 
Can you give a good reason why absolute value has a build in function while percentage is not?

ב דצמ׳ 18, 2017 17:44, hubert depesz lubaczewski כתב:
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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux