R
Ron
I have a query as follows that takes about 5 minutes to execute but produces
the correct results:
SELECT DISTINCT [NAME], [ADDRESS]
FROM TABLE1
WHERE NAME NOT IN (SELECT NAME FROM TABLE2);
I have tried replacing it with a join which is much faster but still shows
some rows where TABLE1.NAME is in TABLE2.NAME. I have tried different
operators (<,>) and join types but can't get it to work properly:
SELECT DISTINCT TABLE1.[NAME], TABLE1.[ADDRESS]
FROM TABLE1, TABLE2
WHERE TABLE1.NAME <> TABLE2.NAME;
Any help appreciated,
Ron.
the correct results:
SELECT DISTINCT [NAME], [ADDRESS]
FROM TABLE1
WHERE NAME NOT IN (SELECT NAME FROM TABLE2);
I have tried replacing it with a join which is much faster but still shows
some rows where TABLE1.NAME is in TABLE2.NAME. I have tried different
operators (<,>) and join types but can't get it to work properly:
SELECT DISTINCT TABLE1.[NAME], TABLE1.[ADDRESS]
FROM TABLE1, TABLE2
WHERE TABLE1.NAME <> TABLE2.NAME;
Any help appreciated,
Ron.