Hey there, I'm kinda stuck trying to optimise a query which has a NOT EXISTS clause on a nested SELECT. I've been rewriting my queries containing nested selects, changing them to joins, but on this occasion I'm not sure how to combine that with the NOT EXISTS clause. I have the following query:
SELECT `reg_no`, COUNT(*) AS `records_found` FROM (`club_records` AS `cr`) WHERE NOT EXISTS ( SELECT `number` FROM `members` WHERE `members`.`number` = `cr`.`alt_reg_no` )