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

From Richard Broersma Jr
Subject Re: Calculating percentages in Postgresql
Date
Msg-id 281183.19684.qm@web31815.mail.mud.yahoo.com
Whole thread Raw
In response to Calculating percentages in Postgresql  (Peter Nixonn <listuser@peternixon.net>)
List pgsql-general
--- Peter Nixonn <listuser@peternixon.net> wrote:

> Hi Guys
>
>
> Has anyone written a postgres function to calculate percentages without
> giving "ERROR:  division by zero" when fed zeros?

maybe you could employee the nullif() function to trap zeros for this?
http://www.postgresql.org/docs/8.2/interactive/functions-conditional.html#AEN13119

Regards,

Richard Broersma Jr.

pgsql-general by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: Calculating percentages in Postgresql
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Client SSL validation using root.crt