Re: Calculating percentages in Postgresql - Mailing list pgsql-general

From Tino Wildenhain
Subject Re: Calculating percentages in Postgresql
Date
Msg-id 45631199.3040700@wildenhain.de
Whole thread Raw
In response to Calculating percentages in Postgresql  (Peter Nixonn <listuser@peternixon.net>)
List pgsql-general
Peter Nixonn schrieb:
> Hi Guys
>
>
> Has anyone written a postgres function to calculate percentages without
> giving "ERROR:  division by zero" when fed zeros?
>
What is the expected result when you feed zeros?
What is your use-case? 0 out of 0 or something?
Should that mean 100% or 0%? :-) Or just: Null
(as "dont't know")

Its easy when you fully know your problem :-)

Regards
Tino


pgsql-general by date:

Previous
From: Matthias.Pitzl@izb.de
Date:
Subject: Re: Extract between year *and* month
Next
From: Richard Broersma Jr
Date:
Subject: Re: Calculating percentages in Postgresql