I have a small racing project that uses a MySQL backend. I am trying to find a good query for grabbing the details of all drivers that have placed in the top 3 positions in more than two races. Here’s a small table breakdown:
Drivers table:
driver_id, driver_name, driver_age, etc misc details
Entry table:
entry_id, driver_id, placed
So, normally this wouldn’t be a huge issue since I could just do a JOIN on driver_id and then use WHERE on my 'placed' column to thin down the results; however, the client absolutely must have the guys who placed in the top 3 more than once. I would just take care of it on the script side of things but the app they are using to pull in the data is very odd.
Thanks!
or something like this… I know you are looking for the having clause on a count statement