Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3927D476507 for ; Wed, 3 Jul 2002 16:31:32 -0400 (EDT) Mailbox-Line: From teknokrat@yahoo.com Wed Jul 3 16:31:32 2002 Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id E3A4C475E92 for ; Wed, 3 Jul 2002 14:35:14 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 1AA08381D51; Wed, 3 Jul 2002 14:34:21 -0400 (EDT) From: teknokrat@yahoo.com (teknokrat) X-Newsgroups: comp.databases.postgresql.sql Subject: Can this be done with sql? Date: 3 Jul 2002 11:32:17 -0700 Organization: http://groups.google.com/ Lines: 11 Message-ID: <1cbae208.0207031032.7d1be1a2@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Spam-Status: No, hits=1.3 required=5.0 tests=SUBJ_ENDS_IN_Q_MARK,FROM_NAME_NO_SPACES,FORGED_YAHOO_RCVD version=2.30 X-Spam-Level: * X-Archive-Number: 200207/43 X-Sequence-Number: 8422 In my database i have values recorded in one minute intervals. I would like a query that can get me results for other time intervals. For example - return maximum value in each 3 minute interval. Any ideas how i can do this with sql? I tried writing a procedure in plsql but i am told it does not support tuples as output. I can get the all the one minute intervals and process them to get me three minute intervals in my application but i would rather not do the expensive call for the one minute intervals in the first place due to the large number of data. any ideas? thanks