Eugene Elutin (9/12/2012)
You don't really need last join as the last digit of the second number can only be '3'
Wouldn't that be cheating?
Because that way I can get the best performance
SELECT 41286 num1,
7953 num2
I had my solution that was very similar to yours (again) but using the different(<>) operators instead of the NOT IN.
However, a better performance would be using the best datatype for the digits (char) since the beginning avoiding additional conversions.