It's difficult to answer this without understanding your table structures. You seem to want to compare "misses" with total records. Your first query must be returning the "misses". How would you return total records on your database ? Once you've got that, you can join the two queries together and get the information you want.