Search Postgresql Archives

Re: PostgreSQL needs percentage function

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

 



On Mon, Dec 18, 2017 at 11:01 AM, David G. Johnston <david.g.johnston@xxxxxxxxx> wrote:
​Do you mean:

SELECT id, val, val / (sum(val) OVER ())
FROM vals;​


You could end up with a percentage > 100 or divide by 0 with that if the values are not in a proper range.  I don't know if that would be the intention.


[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