I’m error checking a search index table (asIndex) that is built by a script from 25 tables.
Both the asIndex and Evaluations tables have multiple rows per address.
So this query was an attempt to be sure that everywhere an index row has Evaluation = ‘blue’ that there was at least one row in Evaluations where Evaluation is set to ‘blue’.
It works but it produces 40K rows.
SELECT
ev.`Street Name`,
ev.`Street Number`,
ev.Evaluation
FROM
`tblEvaluations` ev,
`asIndex` asi
WHERE asi.`Evaluation` = 'blue'
AND asi.`StreetName` = ev.`Street Name`
AND asi.`StreetNumber` = ev.`Street Number`;
What I need to do is make a query that will list any address which has a blue Evaluation in the asIndex but for which there is no matching address in Evaluations table with a blue Evaluation value.
How do I select that negative match?
You could use a left join.