I’m attempting to write a query that will allow me to get any record from one table if the id doesn’t exist in another table, or if it does exist and it also meets a second criteria. Below is what I attempted to do, but it always returns 0 rows:
SELECT p.pageid, p.pager FROM pages p, updates u
WHERE p.pageid NOT IN (SELECT pageid FROM updates)
OR (p.pageid = u.pageid AND u.pagenums > 1000) LIMIT 100
From what I can tell this should work, but it’s not. Any help is appreciated.
Maybe try with this query