A person had this query, it would run for over 24 hours. Wow, that is pretty bad, I don’t think I had ever written something that ran over an hour, and the ones I did were mostly defragmentation and update statistics jobs.
Only In A Database Can You Get 1000% + Improvement By Changing A Few Lines Of Code. In this case the query run time went from 24 hours+ to 36 seconds!!!