X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9E0949FB369 for ; Fri, 22 Sep 2006 11:11:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 73348-02 for ; Fri, 22 Sep 2006 11:11:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from alimail.net (potatis.alimail.net [84.19.131.11]) by postgresql.org (Postfix) with ESMTP id 475D99FB33F for ; Fri, 22 Sep 2006 11:11:40 -0300 (ADT) Received: from [192.168.1.10] ([84.19.128.181]) by alimail.net (alimail.net [10.1.8.71]) (MDaemon.PRO.v8.0.4.R) with ESMTP id md50000789839.msg for ; Fri, 22 Sep 2006 16:11:01 +0200 In-Reply-To: <55c095e90609220652t356c8591u412046aed091a52f@mail.gmail.com> References: <55c095e90609220652t356c8591u412046aed091a52f@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Niklas Johansson Subject: Re: Group by minute Date: Fri, 22 Sep 2006 16:10:54 +0200 To: "Ezequias Rodrigues da Rocha" X-Mailer: Apple Mail (2.752.2) X-Spam-Processed: alimail.net, Fri, 22 Sep 2006 16:11:01 +0200 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 84.19.128.181 X-Return-Path: spot@tele2.se X-MDaemon-Deliver-To: pgsql-sql@postgresql.org Reply-To: spot@tele2.se X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.02 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200609/153 X-Sequence-Number: 26364 On 22 sep 2006, at 15.52, Ezequias Rodrigues da Rocha wrote: > I have a query but my IDE (Delphi) does not accept "to_char" > capability. Is there a way to reproduce the same query without > using to_char function ? > > ... > GROUP BY to_char(quando,'dd/MM/yyyy HH24:MI') To group by minute, you can try GROUP BY date_trunc('minute', quando) or even GROUP BY EXTRACT(EPOCH FROM quando)::integer / 60 Sincerely, Niklas Johansson