From: David Stanaway <david@stanaway.net>
To: pgsql-sql@postgresql.org
Subject: Re: how to sort a birthday list ?
Date: 20 Jun 2002 16:32:50 -0500
Message-ID: <1024608770.9198.75.camel@ciderbox> (raw)
In-Reply-To: <3D122508.70104@shifted-bytes.de>
References: <3D122508.70104@shifted-bytes.de>
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
Attachments:
signature.asc (application/pgp-signature, 480B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: david@stanaway.net
Subject: Re: how to sort a birthday list ?
In-Reply-To: <1024608770.9198.75.camel@ciderbox>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox