It should be possible to filter based on a subselect from another grubby query. Here is an example looking for rows in the table that have a category_id not in the category table.
Mapping to SQL:
SELECT * FROM table
WHERE NOT(category_id IS NULL)
AND NOT(category_id IN (SELECT category_id FROM categories))
EXCEPTION: The subselect table may be in a separate database. Question, should we account for this?