Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 64C84B5DBF0 for ; Wed, 24 Aug 2011 11:07:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 95616-06 for ; Wed, 24 Aug 2011 14:07:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id A9CF7B5DBDC for ; Wed, 24 Aug 2011 11:07:40 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QwE7F-0006yt-0d for pgsql-sql@postgresql.org; Wed, 24 Aug 2011 16:07:37 +0200 Received: from g224046098.adsl.alicedsl.de ([92.224.46.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Aug 2011 16:07:37 +0200 Received: from tim by g224046098.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Aug 2011 16:07:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: pgsql-sql@postgresql.org To: pgsql-sql@postgresql.org From: Tim Landscheidt Subject: Re: Confused about writing this stored procedure/method. Date: Wed, 24 Aug 2011 14:07:24 +0000 Organization: Lines: 14 Message-ID: References: <1314023902196-4723656.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: g224046098.adsl.alicedsl.de Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:xYZC3i9la4Y77S6KquGotsVvHys= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.405 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.505 X-Spam-Level: X-Archive-Number: 201108/99 X-Sequence-Number: 35767 (anonymous) wrote: > [...] > I intend pass the number of the month(say 1 for January , 2 for February > etc>) as the parameter to this method and return a number that corresponds > to the index of the month in the new order , say I pass 8 for August , I > return 11 , in order to get the index of August in he financial year > calendar somewhat like this > [...] You don't need any function for that, just use "ORDER BY Month < 4, Month". Tim