Hi Steve,
The final solution that was provided by the poster would run extremely slowly when dealing with larger row counts and a simple way of avoiding this can be implemented that has practical uses in optimising complex queries in general.
I would be happy to explain with examples.
Claire