• It looks like some of those group bys are unneccessary. Check out Jesper's code for the best 2k approach to date. As far as an explanation goes, This code evolved quite a bit, I never reviewed the code as a whole prior to posting.

    In fact, the 2k code was based on the same approach used in the 2k5 code.

    SQL guy and Houston Magician