Basically, I want to get all rows from the customers table that do NOT appear in the brochure_requests table.
SELECT *
FROM customers JOIN brochure_requests
WHERE brochure_requests.first_name != customers.customer_first_name
AND brochure_requests.last_name != customers.customer_last_name
The query works when the parameters are =, but as soon as I run a != query, the program (HeidiSQL) hangs indefinitely or until I cancel it.
Use
NOT EXISTS, e.g.I would also suggest adding an index on the
brochure_requests.first_nameandbrochure_requests.last_namefields for improved performance.