Hello,
I am trying to build a query that will display the top 5 members of my "virtual airline" based on the total hours flown for the month. Whenever a pilot files a completed flight plan, the data is stored in a table containing the following rows.
MID (member ID)
hours (hours flown)
month (the month of the flight)
There will be hundreds of flights per member (or MID).
I need a query that will sum the hours for each pilot for this month, then order it from highest to lowest (limit of 5). I've tried for hours to come up with the proper query and I keep drawing a blank.
The site is written in PHP. Thank you for any help you can provide! I am sorry if I left out anything, I am new to this site and MySQL
I am trying to build a query that will display the top 5 members of my "virtual airline" based on the total hours flown for the month. Whenever a pilot files a completed flight plan, the data is stored in a table containing the following rows.
MID (member ID)
hours (hours flown)
month (the month of the flight)
There will be hundreds of flights per member (or MID).
I need a query that will sum the hours for each pilot for this month, then order it from highest to lowest (limit of 5). I've tried for hours to come up with the proper query and I keep drawing a blank.
The site is written in PHP. Thank you for any help you can provide! I am sorry if I left out anything, I am new to this site and MySQL
Comment