Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2FF439FB42B for ; Fri, 20 Apr 2007 13:13:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 54988-04 for ; Fri, 20 Apr 2007 13:13:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from talk.nabble.com (www.nabble.com [72.21.53.35]) by postgresql.org (Postfix) with ESMTP id 2B3499FB51C for ; Fri, 20 Apr 2007 13:13:38 -0300 (ADT) Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1Hevjt-0005rb-Bb for pgsql-sql@postgresql.org; Fri, 20 Apr 2007 09:13:37 -0700 Message-ID: <10105471.post@talk.nabble.com> Date: Fri, 20 Apr 2007 09:13:37 -0700 (PDT) From: RPK To: pgsql-sql@postgresql.org Subject: Re: Retrieve month from date In-Reply-To: <11604f180704200519h5d858f6ey1efbbccd52ccd0c9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: rpk.general@gmail.com References: <11604f180704200519h5d858f6ey1efbbccd52ccd0c9@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/190 X-Sequence-Number: 28190 Thanks both of you, I ran EXPLAIN command on above suggested query and got following result: "Aggregate (cost=2.77..2.79 rows=1 width=10)" " -> Seq Scan on studentfeespayment (cost=0.00..2.77 rows=1 width=10)" " Filter: (date_part('month'::text, (recieptmonthyear)::timestamp without time zone) = 4::double precision)" What does this mean? Can I optimize it better? -- View this message in context: http://www.nabble.com/Retrieve-month-from-date-tf3617513.html#a10105471 Sent from the PostgreSQL - sql mailing list archive at Nabble.com.