I currently have the following, and I've read that it's generally better to avoid "IN" and use "EXISTS" instead (1, 2). Though I've read that EXISTS is faster and more consistent, I don't think I've grasped entirely why that is, or how I would go about rewriting this to use EXISTS instead.
SELECT qryAccountNamesConcat.AccountID, qryAccountNamesConcat.AccountName, qryAccountNamesConcat.JobTitle
FROM qryAccountNamesConcat
WHERE (((qryAccountNamesConcat.AccountID) In (
SELECT AccountID
FROM tblAccount
WHERE AccountTypeID IN (1, 2))
Or
qryAccountNamesConcat.AccountID In (
SELECT ChildAccountID
FROM qryAccJunctionDetails
WHERE ParentAccountTypeID IN (1, 2))
));
Basically, Where AccountTypeID = 1 or 2 this is a trade or private customer account, so I am looking for accounts which are, or which are children of (usually employees of) customer accounts.