Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4E7E7B5DBF9 for ; Sat, 15 Oct 2011 04:09:18 -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 24852-08 for ; Sat, 15 Oct 2011 07:09:11 +0000 (UTC) X-Greylist: delayed 00:17:19.21756 by SQLgrey-1.8.0-rc2 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id BCDB4B5DBF5 for ; Sat, 15 Oct 2011 04:09:11 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1REy62-0002c6-RI for pgsql-sql@postgresql.org; Fri, 14 Oct 2011 23:51:50 -0700 Date: Fri, 14 Oct 2011 23:51:50 -0700 (PDT) From: "maya.more" To: pgsql-sql@postgresql.org Message-ID: <1318661510830-4904685.post@n5.nabble.com> Subject: Group by on Date MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.767 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201110/22 X-Sequence-Number: 35906 I have a table with Date and unit column. . I want to find sum of unit column considering 3 days each User will specify start and enddate Eg Date Unit 10/1/2011 1 10/2/2011 2 10/3/2011 3 10/4/2011 4 10/5/2011 4 10/6/2011 1 10/7/2011 2 10/8/2011 3 10/9/2011 1 10/10/2011 1 10/11/2011 1 suppose if user selects date 10/1/2011 to 10/6/2011 then output should be start date enddate unit 10/1/2011 10/3/2011 6 10/4/2011 10/6/2011 9 pls let me know if anybody has any idea. Thanks in advance -- View this message in context: http://postgresql.1045698.n5.nabble.com/Group-by-on-Date-tp4904685p4904685.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.