score:1

Accepted answer

You can use the ISNULL solution like mentioned in the comments.

Another way you could write the query is this:

SELECT #t1.AccountID AS acct, #t1.Name AS [name], #t1.Address AS [add]
FROM #t1        
LEFT JOIN #t2 ON #t1.AccountID = #t2.AccountNo
             AND #t2.type = 'ex' --In case you add additional types to #t2
WHERE #t2.AccountNo IS NULL;

More questions

More questions with similar tag