select query joining a large table has:
SELECT DISTINCT State, StateCode, McountID AS mtfkparam
FROM commercial LEFT JOIN Mcount on (Mcount.MCountFIPS = commercial.CountFIPS AND McountID = 'X')
WHERE (StateCode!= 'AS') AND (StateCode!= 'AA') AND (StateCode!= 'AE') AND (StateCode!= 'AP') AND (StateCode!= 'FM') AND (StateCode!= 'MP') AND (StateCode!= 'PW')ORDER BY 'State'
Here 'X' is simply equal to a session variable.
Is there a faster way of executing the 7 WHERE (StateCode!=....
'StateCode's are in table 'commercial' which also has CountFIPS // county codes