• Steve,

    No problem! A second set of eyes is always nice to have, especially towards the end of a Friday 🙂

    Of the two working queries I posted, it's still a bit funny to me how much more efficient the first one got when I removed the superfluous MIN. It seems to be getting it all in one scan, which is nice, and I like how concise it looks.

    Having said that, it's also not quite as obvious what it's doing as the fixed (and prettified, thank you!) version of the OP's code.

    Cheers!