Re: [SQL] Calculating the age of a person

2001-05-22 Thread Najm Hashmi
Hans-Jürgen Schönig wrote: > I have a table containing the birthdays of various persons. The target > is to compute the age of a persons. > > persons=# SELECT age(birth), * FROM persons LIMIT 1; > age | id | name | birth| gender | > income > ---

Re: [SQL] Calculating the age of a person

2001-05-20 Thread Cedar Cox
Or you could use date_trunc() in the same way as date_part() if you want an interval instead.. SELECT date_trunc('year',age(birth)),* FROM persons LIMIT 1; On Fri, 18 May 2001, [EMAIL PROTECTED] wrote: > You are probably looking for date_part(). > > E.g. > > SELECT date_part('year',age(birt

Re: [SQL] Calculating the age of a person

2001-05-18 Thread [EMAIL PROTECTED]
You are probably looking for date_part(). E.g. SELECT date_part('year',age(birth)),* FROM persons LIMIT 1; Troy > > I have a table containing the birthdays of various persons. The target > is to compute the age of a persons. > > persons=# SELECT age(birth), * FROM persons LIMIT 1; >

[SQL] Calculating the age of a person

2001-05-18 Thread Hans-Jürgen Schönig
I have a table containing the birthdays of various persons. The target is to compute the age of a persons. persons=# SELECT age(birth), * FROM persons LIMIT 1; age | id | name | birth| gender | income ---++++--