locked
Urgent SQL access help RRS feed

  • Question

  • User431254492 posted

    Please, please, please can anyone help me.  I have a database of childrens names, address and dob, I need a query that will return only the oldest child if more than one child live at the same address.

     

    Thank you

    Tuesday, March 31, 2009 10:48 AM

Answers

  • User-1557807525 posted

    For that you required isAlive bit field or doe so that you can take the results

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 31, 2009 1:19 PM
  • User-319574463 posted

     Try a select like:

    SELECT Address, MIN(Dob) FROM Child GROUP BY Address

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 2, 2009 7:50 AM

All replies

  • User-1557807525 posted

    For that you required isAlive bit field or doe so that you can take the results

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 31, 2009 1:19 PM
  • User-319574463 posted

     Try a select like:

    SELECT Address, MIN(Dob) FROM Child GROUP BY Address

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 2, 2009 7:50 AM