Michael,

> SELECT *
> FROM Persons
> WHERE EXTRACT( YEAR FROM AGE(dateofbirth) ) < EXTRACT( YEAR FROM AGE( 
> CURRENT_DATE+60, dateofbirth ) )
> 
> ... but how do I sort the list ?

Easy:

SELECT person_name, person_department,  EXTRACT( YEAR FROM AGE(dateofbirth) ) 
as their_age
FROM Persons
WHERE EXTRACT( YEAR FROM AGE(dateofbirth) ) < EXTRACT( YEAR FROM AGE( 
CURRENT_DATE+60, dateofbirth ) )
ORDER BY their_age, person_name

As an example.





-- 
-Josh Berkus


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to