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.petra...@unipex.it>
To: "Oliveiros d'Azevedo Cristina" <oliveiros.crist...@marktest.pt>
Cc: <pgsql-sql@postgresql.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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql