Stored Procedure in postgresql, multiple queries w/ agreggates.

Posted by fenix on Stack Overflow See other posts from Stack Overflow or by fenix
Published on 2010-05-05T22:31:44Z Indexed on 2010/05/05 22:38 UTC
Read the original article Hit count: 226

I'm trying to write a store procedure that can take some input parameters (obviously), run multiple queries against those, taking the output from those and doing calculations, and from those calculations and the original queries, outputting a formatted text string like:

Number of Rows for max(Z) matching condition x and y of total rows matching x (x&y/x*100).

To explain the max(Z) bit, this will be the username field, it won't matter which actual entry is picked, because the where clause will filter the results by user id, is there a saner way to do this?

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about agreggate