Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id C6C291337B53 for ; Fri, 26 Nov 2010 12:25:23 -0400 (AST) 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 48189-08 for ; Fri, 26 Nov 2010 16:25:16 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 865C71337B43 for ; Fri, 26 Nov 2010 12:25:16 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id oAQGPGjh059348 for ; Fri, 26 Nov 2010 12:25:16 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id oAQG76Aw017842 for pgsql-sql@postgresql.org; Fri, 26 Nov 2010 12:07:06 -0400 (AST) (envelope-from news) From: Lew X-Newsgroups: pgsql.sql Subject: Re: group by hour + distinct Date: Fri, 26 Nov 2010 11:07:05 -0500 Organization: albasani.net Lines: 20 Message-ID: References: <4CEF9C66.30100@unipex.it> <4CEFAB4F.6000109@unipex.it> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <4CEFAB4F.6000109@unipex.it> Cancel-Lock: sha1:W8hmhy+Pse5EAOoE6K1k78mEj3U= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.14) Gecko/20101006 Thunderbird/3.0.9 Injection-Info: news.albasani.net; logging-data="eswK3QcS7OE9Z+2hcnL4sWDc59/NF5Edrw+YAXTrzA+M7QR+IhO8vlYl9LjTsarZC//aj+LjCALo4bwbTHM/OF0Fs3iSp26jsUZiEMzR7hZAfLXxuIpAo5vRwbUDNu4s"; mail-complaints-to="abuse@albasani.net" To: pgsql-sql@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-5 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/72 X-Sequence-Number: 34810 Michele Petrazzo - Unipex wrote: > P.s. Have you some references about the "subquery" keyword? I found only > the word subquery as "use" (for example: select a from b where id in > (select id from table)), but not as sql [sic] command. "subquery" is not an SQL keyword. Nor is it a command all by itself. Reading the documentation might help you: Or try: -- Lew