• I learned a lot from this QOTD. Count me as someone else who didn't know there was such a thing as conditional order by.

    I can see the utility of this and I can see that an implicit cast could cause problems, even an error-less unintentional sort as Tony++ mentions.

    Thanks to depak.a for providing a solution to the implicit cast problem.

    The swapping of string1/string2 was probably an unnecessary distraction but debugging with "distractions" is a part of life. I readily grant license to QOTD authors to add tricks if they prefer that type of question.