I'm working on MySQL v5.0 and I have a table with dateOfBirth and I want
a histogram of ages at a point in time.  I tried something like:

  select round(datediff(curdate(), dateofbirth)/365) as age, count(age) 
  from myTable group by age;

but MySQL Query Browser says:

  Unknown column 'age' in 'field list' 1054

What am I doing wrong?  How can I count ages?

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to