Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C8E041337BE5 for ; Fri, 17 Sep 2010 11:50:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 14964-01 for ; Fri, 17 Sep 2010 14:50:38 +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 37629133798E for ; Fri, 17 Sep 2010 11:50:36 -0300 (ADT) Received: from unipex-local-server (unipex.wipex [172.16.20.247]) by smtp.go-wipex.it (Postfix) with ESMTP id C5C3F10B00A4 for ; Fri, 17 Sep 2010 16:50:35 +0200 (CEST) Received: from [192.168.1.103] (michele [192.168.1.103]) by unipex-local-server (Postfix) with ESMTP id 5B976560001 for ; Fri, 17 Sep 2010 16:50:35 +0200 (CEST) Message-ID: <4C93803A.4080706@unipex.it> Date: Fri, 17 Sep 2010 16:50:34 +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: "pgsql-sql@postgresql.org" Subject: all the table values equal 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=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201009/48 X-Sequence-Number: 34579 Hi list, this is a Friday afternoon question... :) I have a table like this: id_user | value | datetime 1 | 1 | xxx 1 | 2 | xxx+1 1 | -1 | xxx+2 2 | -1 | xxx 2 | -1 | xxx+1 3 | 4 | xxx 3 | 10 | xxx+1 I'm trying to create a query that say me which id_user, inside a interval of time, has all the values -1 The part if the interval it's not a problem, but I'm fighting with the aggregate... Someone? Thanks, Michele