michael.kaufmann (12/6/2011)
One minor flaw I'd attribute to speedily writing this query--the above one will only yield the same result as the original one if only employees are the customers and the IDs as customer and employee are equal.
Thanks Michael - I did indeed write the syntax quickly, just from the execution plan, before Hugo so helpfully posted table definitions and sample data. That'll teach me, I guess.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi