After messing around with this for a few more hours, and reading articles, manuals etc., I have come to the conclusion there is no real way to do what I want to do efficiently, so I've written 496 database queries in nested while{} loops to handle it . . .
Just kidding, but I do think I need to do this with multiple queries, or run a script that pulls the data I need to search and puts it all in one temporary table.