G
Guest
Both queries perform the same function (at least it appears that way). Which
query is better from a performance stand point.
#1
SELECT BatchLocationTable.BatchLocation
FROM BatchLocationTable LEFT JOIN ActiveBatchLocation ON
BatchLocationTable.BatchLocation = ActiveBatchLocation.BatchLocation
WHERE BatchLocationTable.BatchLocation NOT IN
(ActiveBatchLocation.BatchLocation);
or
#2
SELECT BatchLocationTable.BatchLocation
FROM BatchLocationTable
WHERE BatchLocationTable.BatchLocation NOT IN (SELECT
ActiveBatchLocation.BatchLocation FROM ActiveBatchLocation);
query is better from a performance stand point.
#1
SELECT BatchLocationTable.BatchLocation
FROM BatchLocationTable LEFT JOIN ActiveBatchLocation ON
BatchLocationTable.BatchLocation = ActiveBatchLocation.BatchLocation
WHERE BatchLocationTable.BatchLocation NOT IN
(ActiveBatchLocation.BatchLocation);
or
#2
SELECT BatchLocationTable.BatchLocation
FROM BatchLocationTable
WHERE BatchLocationTable.BatchLocation NOT IN (SELECT
ActiveBatchLocation.BatchLocation FROM ActiveBatchLocation);