Re: how to sort a birthday list ?

From: David Stanaway <david(at)stanaway(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: how to sort a birthday list ?
Date: 2002-06-20 21:32:50
Message-ID: 1024608770.9198.75.camel@ciderbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 2002-06-20 at 13:55, Michael Agbaglo wrote:
> Hi !
>
> there's a nice query for retrieving the people who have their birthday
> in the next n days: (taken from Joe Celko's SQL for Smarties, 1st Ed.,
> p. 76)
>
> SELECT *
> FROM Persons
> WHERE EXTRACT( YEAR FROM AGE(dateofbirth) ) < EXTRACT( YEAR FROM AGE(
> CURRENT_DATE+60, dateofbirth ) )
>
> ... but how do I sort the list ?

How about:
ORDER BY dateofbirth

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-06-21 00:00:26 Re: SQL performance issue with PostgreSQL compared to
Previous Message Michael Agbaglo 2002-06-20 18:55:04 how to sort a birthday list ?