Hi,
I am running the query below on a table with around 100k rows in it using a NOT IN and the performance is terrible. Is there another way of achieving the same result?
SELECT c.Id, c.Name, c.address, c.town,
c.county, c.postcode, FROM contractor AS c
inner join Order w
on w.Id = c.Id WHERE (c.valid = 1) and c.Id not in
(select w.Id from Order w) ORDER BY c.Name ASC
Thanks