Dredging up an old topic - but I'm facing this situation right now. Like Oliver, I'm looking for a way to compare two fields in a selector statement to avoid looping through pages and "collecting" only the ones that have the mismatched field values. It's agreeably inefficient when there are thousands of pages to go through.
but don't think this could be accomplished with a single selector, or even with a single SQL query
I'm definitely not a SQL guru by any means, so I had to turn to Google for this one - just in case someone had a solution. Surely, others have faced the same SQL problem before.
Lo' and behold, I think there IS a way to do it! Here's an example of the SQL statement that takes advantage of MySQL's CONCAT function:
SELECT *
FROM movie_musicals
WHERE NOT (year_one LIKE CONCAT(`year_two`))
And here's an example fiddle I threw together:
http://sqlfiddle.com/#!2/3bed6/1/0
What are the chances of figuring out how to do this with just one PW selector statement? *crossing my fingers*.
Or even just a SQL statement to run and have page id's of pages with mismatches being returned ?