From: Justin Graf <justin@magwerks.com>
To: Wes James <comptekki@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: how to construct sql
Date: Wed, 02 Jun 2010 16:45:16 -0500
Message-ID: <4C06D0EC.9050206@magwerks.com> (raw)
In-Reply-To: <AANLkTimpIxZCKcSRRzNukug6hrYL8LrfYyKuWWcz0b3T@mail.gmail.com>
References: <AANLkTik3O3L0PLqy4SN5oHy9zSBf8TDLXzGZcPYLtEXf@mail.gma?= =?utf-8?Q?il.com>
<597755AB8EE8458F92F4B7C6588E5C03@marktestcr.marktest.pt?= =?utf-8?Q?>
<AANLkTikQCTiXkz0n2wPp=5FkvK6KIf-rXngFb=5F7UDdfb0y@mail.gmail.com>
<4C06C2A6.8080503@magwerks.com>
<AANLkTimpIxZCKcSRRzNukug6hrYL8?= =?utf-8?Q?LrfYyKuWWcz0b3T@mail.gmail.com>
On 6/2/2010 2:52 PM, Wes James wrote:
>
> **snip***
> Thx it is closer (with an end in the case):
>
> select
> case when MAX(page_count_count) - MIN(page_count_count)> 0 then
> MAX(page_count_count) - MIN(page_count_count)
> else
> MAX(page_count_count)
> end as day_max
> from page_count
> group by page_count_pdate order by page_count_pdate;
>
> the else puts out the total count on that day. I would need
> max(page_count_count) - max(page_count_count_of_previous_day)
>
> thx,
>
> -wes
>
A windowing query makes sense in this case which i'm not very good at
All legitimate Magwerks Corporation quotations are sent in a .PDF file attachment with a unique ID number generated by our proprietary quotation system. Quotations received via any other form of communication will not be honored.
CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally privileged, confidential or other information proprietary to Magwerks Corporation and is intended solely for the use of the individual to whom it addresses. If the reader of this e-mail is not the intended recipient or authorized agent, the reader is hereby notified that any unauthorized viewing, dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and destroy all occurrences of this e-mail immediately.
Thank you.
Attachments:
[text/x-vcard] justin.vcf (256B, ../4C06D0EC.9050206@magwerks.com/2-justin.vcf)
download | inline:
begin:vcard
fn:Justin Graf
n:Graf;Justin
org:Magwerks Corp
adr:;;501 Commerce Drive;Danville ;IN;46122;USA
email;internet:justin@magwerks.com
tel;work:317-241-8011 ext 703
tel;fax:317-241-8015
x-mozilla-html:FALSE
url:www.magwerks.com
version:2.1
end:vcard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: justin@magwerks.com, comptekki@gmail.com
Subject: Re: how to construct sql
In-Reply-To: <4C06D0EC.9050206@magwerks.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox