Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 6995D4770CD for ; Thu, 20 Jun 2002 15:11:34 -0400 (EDT) Received: from mailout01.sul.t-online.com (mailout01.sul.t-online.com [194.25.134.80]) by postgresql.org (Postfix) with ESMTP id 9042B476C51 for ; Thu, 20 Jun 2002 14:55:11 -0400 (EDT) Received: from fwd02.sul.t-online.de by mailout01.sul.t-online.com with smtp id 17L75L-0003xv-0A; Thu, 20 Jun 2002 20:55:11 +0200 Received: from avocado.shifted-bytes.de (520056191158-0001@[217.224.247.250]) by fmrl02.sul.t-online.com with esmtp id 17L75G-1UkQkaC; Thu, 20 Jun 2002 20:55:06 +0200 Received: from shifted-bytes.de (orange.shifted-bytes.de [10.0.0.14]) by avocado.shifted-bytes.de (8.12.2/8.12.2) with ESMTP id g5KIt4mI002833 for ; Thu, 20 Jun 2002 20:55:05 +0200 (CEST) Message-ID: <3D122508.70104@shifted-bytes.de> Date: Thu, 20 Jun 2002 20:55:04 +0200 From: Michael Agbaglo User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: how to sort a birthday list ? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Sender: 520056191158-0001@t-dialin.net X-Archive-Number: 200206/279 X-Sequence-Number: 8244 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 ?