Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D43E51337B60 for ; Tue, 21 Sep 2010 11:43:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 98814-04 for ; Tue, 21 Sep 2010 14:43:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.go-wipex.it (mx1.go-wipex.it [89.202.235.7]) by mail.postgresql.org (Postfix) with ESMTP id 9CCEA133616B for ; Tue, 21 Sep 2010 11:43:26 -0300 (ADT) Received: from unipex-local-server (unipex.wipex [172.16.20.247]) by smtp.go-wipex.it (Postfix) with ESMTP id 16A6910B0098; Tue, 21 Sep 2010 16:43:26 +0200 (CEST) Received: from [192.168.1.103] (michele [192.168.1.103]) by unipex-local-server (Postfix) with ESMTP id EB05D560001; Tue, 21 Sep 2010 16:43:25 +0200 (CEST) Message-ID: <4C98C48D.1070103@unipex.it> Date: Tue, 21 Sep 2010 16:43:25 +0200 From: Michele Petrazzo - Unipex User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060724 Thunderbird/2.0a1 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: Oliveiros d'Azevedo Cristina CC: pgsql-sql@postgresql.org Subject: Re: all the table values equal 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> In-Reply-To: <5E43A989C2FA4F60B146DAC454BAA21D@marktestcr.marktest.pt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-5 required=5 tests=BAYES_20=-0.001 X-Spam-Level: X-Archive-Number: 201009/67 X-Sequence-Number: 34598 Oliveiros d'Azevedo Cristina ha scritto: > > OK, So, analysing your new question, the time interval is still > important? Or no longer? It's important but simple to translate into sql, so I remove it from my question. > So writting your query in english : "I want all users that don't change > "value" and their value is equal to x ?" > Yes. All the users that have only one value into the "value" column and that value is NN. > 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 Thanks, Michele