Re: Calculating percentages in Postgresql

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Peter Nixonn <listuser(at)peternixon(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Calculating percentages in Postgresql
Date: 2006-11-21 14:47:53
Message-ID: 45631199.3040700@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2006-11-21 15:01:44 Re: Calculating percentages in Postgresql
Previous Message Jerry Sievers 2006-11-21 14:38:52 Re: Calculating percentages in Postgresql