Received: from trends.net (root@clio.trends.ca [209.47.148.2]) by hub.org (8.8.8/8.7.5) with ESMTP id FAA29747 for ; Thu, 11 Jun 1998 05:04:09 -0400 (EDT) Received: from proxy.bazzanese.com (sferac@ip154.tol11.interbusiness.it [195.120.106.154]) by trends.net (8.8.8/8.8.8) with ESMTP id FAA26188 for ; Thu, 11 Jun 1998 05:04:02 -0400 (EDT) Received: from localhost (sferac@localhost) by proxy.bazzanese.com (8.8.8/8.8.8/Debian/GNU) with SMTP id KAA03117; Thu, 11 Jun 1998 10:52:59 GMT Date: Thu, 11 Jun 1998 10:52:59 +0000 (UTC) From: "Jose' Soares Da Silva" X-Sender: sferac@proxy To: Tim J Trowbridge cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] Order by birthdate In-Reply-To: <357F4370.5BB8@writeme.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 10 Jun 1998, Tim J Trowbridge wrote: > I'm trying to generate a birthday list ordered by month, then by day. > This is what I thought would work... > > SELECT name,birthdate FROM table WHERE birthdate is not null ORDER BY > date_part('month',birthdate) I don't understand why you need specify month to sort tuples, you may order it by birthday, but if you want it anyway try this: SELECT name, EXTRACT(month FROM birthdate) AS mese FROM table WHERE birthdate is not null ORDER BY mese > > but psql returns: > > ERROR: parser: parse error at or near "(" > > What's the problem? Seems that order by doesn't supports a function as parameter. Jose'