Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 85CCA1337B60 for ; Tue, 21 Sep 2010 12:02:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 76767-06 for ; Tue, 21 Sep 2010 15:02:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by mail.postgresql.org (Postfix) with ESMTP id 09F80133616B for ; Tue, 21 Sep 2010 12:02:26 -0300 (ADT) Received: from Proteu (proteu.marktest.pt [10.61.90.54]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SBPTZ958; Tue, 21 Sep 2010 16:02:23 +0100 Message-ID: From: "Oliveiros d'Azevedo Cristina" To: "Michele Petrazzo - Unipex" Cc: References: <4C93803A.4080706@unipex.it> <438B32316EF6496D9641819BA16447A2@marktestcr.marktest.pt> <4C938D09.3050105@unipex.it> <81C545E3469E4DF58720C282A469E78A@marktestcr.marktest.pt> <4C9868AB.6050200@unipex.it> <5E43A989C2FA4F60B146DAC454BAA21D@marktestcr.marktest.pt> <4C98C48D.1070103@unipex.it> Subject: Re: all the table values equal Date: Tue, 21 Sep 2010 16:02:22 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-5 required=5 tests=BAYES_40=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/70 X-Sequence-Number: 34601 > > Yes. All the users that have only one value into the "value" column and > that value is NN. Understood. Try the query from the previous mail, adding the clause WHERE "value" = NN as I did explain. > >> Or will you need to find all the users that don't change value with just >> one query? And the query would return something like >> >> id_user | value >> 2 | -1 >> 4| 3 >> > > > A right result for me, based by my data, will be: > > // choosing -1 like value > id_user > 2 > > // choosing 3 like value > id_user > 4 > > and if I add to the table: > id_user | value | datetime > 5 | -1 | xxx > 5 | -1 | xxx +1 > > > // choosing -1 like value > id_user > 2 > 5 Understood. From the query I sent you just eliminate the "value" column from the select list, as you are not interested in it. > Thanks, > Michele Best, Oliver