Search Postgresql Archives

Re: Plan to support predicate push-down into subqueries with aggregates?

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

 



On Wednesday, March 9, 2016, rob stone <floriparob@xxxxxxxxx> wrote:
On Wed, 2016-03-09 at 12:25 -0500, Adam Brusselback wrote:

Note that:- (a) I included header_description in the definition.
    (b) Removed some lines as if you want the total you may as well
include it in your select from the view, and for the life of me I
couldn't understand the purpose of:-

header.amount = coalesce(detail_1.amount, 0) +
coalesce(detail_2.amount, 0) as balanced

Is "balanced" supposed to be a boolean?

If you need header.amount include it in the view.


It's basically accounting.  Does the total amount on the header (header.amount) equal the sum of the two components (1.amount + 2.amount), returns true or false based upon the equality.  So not only do you need to compute 1.amount but you also need to immediately use it as part of an _expression_.  And return both usages from the view.

David J.

[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