Re: Tricky math in PSQL

From: Kip Warner <kip(at)thevertigo(dot)com>
To: Kevin Grittner <kgrittn(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Tricky math in PSQL
Date: 2016-04-26 01:46:18
Message-ID: 1461635178.4255.5.camel@thevertigo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, 2016-04-22 at 14:37 -0500, Kevin Grittner wrote:
> Please include such information in the post, either directly or as
> an attachment. Messages on these lists go back over 18 years at
> this point, and while you did flag that paste as "never delete",
> who's to say whether pastebin will be around to keep the promise
> that the URL will be valid 18 years from now?

Hey Kevin,

Noted. In general you are right. Because these queries are a bit long
and sometimes wrap in ugly ways in folks' MUAs making them harder to
read, you'll have to forgive me for this one.

> People can best help you if you provide a self-contained test case
> -- on that actually runs from an empty database. You will get more
> responses, and are more likely to get to a good solution, if you
> simplify the example as far as possible while still showing the
> basic problem -- without ellipses or other non-executable visual
> cues.

Ok, it took me a while to figure out how to populate the tables with
sample random data, but I believe I have a complete self-contained
example that executes.

http://pastebin.com/zwWmYMd0

The two tables statistics and statistics_child are populated with a
large number of rows.

Thank you for your help, Kevin.

--
Kip Warner -- Senior Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Merlin Moncure 2016-04-26 14:13:44 Re: Tricky math in PSQL
Previous Message raghu vineel 2016-04-25 07:40:02 Re: [NOVICE] Fwd: Process scheduling in postgres