I am spliting my SQL in two at some locations to collect first the primary keys and then issue another SQL based on a simple WHERE clause for just the primary keys. Instead of putting a list of conditions separated by a OR, is there a more sufficient approach?