How about this query in MySQL? SELECT * FROM cust_main WHERE 0 < ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.custnum = cust_main.custnum AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = "" OR cust_pkg.cancel = 0 ) ) OR 0 = ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.custnum = cust_main.custnum ) ORDER BY custnum LIMIT 100 OFFSET 1900 -- _ivan