Re: how to construct sql

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: how to construct sql
Date: 2010-06-04 10:01:56
Message-ID: huaiuk$lp2$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2010-06-02, Wes James <comptekki(at)gmail(dot)com> wrote:
> On Wed, Jun 2, 2010 at 10:55 AM, Oliveiros
><oliveiros(dot)cristina(at)marktest(dot)pt> wrote:
>> Hi,
>> Have you already tried this out?
>>
>> select MAX(page_count_count) - MIN(page_count_count)  from page_count group
>> by page_count_pdate.
>>
>>
>> Best,
>> Oliveiros
>
> Oliveiros,
>
> Thx that mostly works. I just tried it and on the days there is only
> 1 entry it is 0 since max is the same as min so max - min is 0. Is
> there a way to take in to account the 1 entry days?

from your original requirement 0 is the correct answer.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Wes James 2010-06-04 13:30:18 Re: sum an alias
Previous Message A. Kretschmer 2010-06-04 05:54:34 Re: sum an alias