Re: [SQL] Order by birthdate - Mailing list pgsql-sql

From Jose' Soares Da Silva
Subject Re: [SQL] Order by birthdate
Date
Msg-id Pine.LNX.3.96.980611104627.2637C-100000@proxy
Whole thread Raw
In response to Order by birthdate  (Tim J Trowbridge <trowbrid@writeme.com>)
List pgsql-sql
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'


pgsql-sql by date:

Previous
From: Aleksey Dashevsky
Date:
Subject: Re: [SQL] update by one transaction
Next
From: Lendvary Gyorgy
Date:
Subject: update by one transaction