Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Posts
    6

    Unanswered: age into age band

    Hi,

    I have a table of members including date of birth value.

    I am not finding any easy way to count the number of members per age band.
    0-10, 10-20,20-30 etc.

    It seems that the decode function works only for equality tests not for other complex conditions.

    Until now, I am using as many count queries as age bands and look whether the date of birth of the member falls between two dates

    Any thoughts?


    Thanks

    Edward

  2. #2
    Join Date
    Sep 2005
    Posts
    22
    what i use is

    select dob, floor(months_between(sysdate,dob)/120) ag from person;


    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •