Web Analytics Made Easy -
StatCounter Age group - CodingForum

Announcement

Collapse
No announcement yet.

Age group

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Age group

    Hi!

    How can I calculate the number of person in a particular age group, i.e.: age 12-18, age 19-25 and so on? Also, can I know where is the Mysql ROOT? I'm using Mysql 4 and JSP, if that helps. Please help, thanks!

  • #2
    Welcome here !
    How can I calculate the number of person in a particular age group, i.e.: age 12-18, age 19-25
    By adding a variable with a value for that agegroup (1,2,3,...) to your table and then running a

    select count(*) from table group by agegroupvariable

    but this requires that you update the agegroupvariable on a users birthday... Else you need to run a subquery or create a temporarely table where you label each birthday with the birthdaycategory. Or you need to do it in your applicationlayer.

    A stored procedure would be the most appropriate way to deal with this, but mySQL doesn't support that yet ...

    where is the Mysql ROOT
    Depends on where you installed it. Look for a folder called 'data' which should contain subfolders named after each db ,and that contain files, named after the tables in each db.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

    Comment


    • #3
      Age Group

      I'll have to try it out first. I've heard of temporary tables before but has yet to try it out. Thank you for your help!!! I'll update you soon...

      Comment

      Working...
      X