Search Postgresql Archives

Re: Calculating percentages in Postgresql

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

 



--- Peter Nixonn <listuser@xxxxxxxxxxxxxx> 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.


[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