andersonjb
Programmer
I'm looking for a faster way of finding all records in one table that are not in the other. This code using a subquery is proving to be very slow-
SELECT id, login
FROM dps_user
WHERE ltrim(rtrim(dps_user.login)) NOT IN
(SELECT ltrim(rtrim(login)) FROM tempdb..all_ldap_users)
dps_user contains 85k + rows, all_ldap_users contains 82k + rows.
SELECT id, login
FROM dps_user
WHERE ltrim(rtrim(dps_user.login)) NOT IN
(SELECT ltrim(rtrim(login)) FROM tempdb..all_ldap_users)
dps_user contains 85k + rows, all_ldap_users contains 82k + rows.