Re: all the table values equal

From: "Oliveiros d'Azevedo Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
To: "Michele Petrazzo - Unipex" <michele(dot)petrazzo(at)unipex(dot)it>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: all the table values equal
Date: 2010-09-20 09:29:21
Message-ID: 81C545E3469E4DF58720C282A469E78A@marktestcr.marktest.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello again, Michele,

I haven't open my mailbox during weekend so I couldn't follow up your
question.

It would help if you explain a little better the background of the problem
you're trying to solve.

You want to find all the user IDs which have the same value on a given time
interval?

Is my understanding correct?

Best,
Oliver

----- Original Message -----
From: "Michele Petrazzo - Unipex" <michele(dot)petrazzo(at)unipex(dot)it>
To: "Oliveiros d'Azevedo Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
Cc: <pgsql-sql(at)postgresql(dot)org>
Sent: Friday, September 17, 2010 4:45 PM
Subject: Re: [SQL] all the table values equal

> Oliveiros d'Azevedo Cristina ha scritto:
>> Howdy , Michele,
>>
>> Give this a try
>>
>> SELECT id_user FROM t_your_table WHERE datetime BETWEEN A -- plug
>> here beginning of interval AND B -- and end here GROUP BY id_user
>> HAVING COUNT(*) = -SUM(value)
>>
>> Then tell me if it gives you what you want
>
>
> Thanks,
> it works, but... it's really a trickle that exploits the value -1 if I
> understand how its work.
> If there is another value where look for? Example 13?
>
> Thanks
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-09-20 19:42:45 Re: Jagged/ragged arrays
Previous Message Florian Weimer 2010-09-20 08:54:36 Jagged/ragged arrays