• pawankkmr 41145 (5/26/2015)


    Complete list of Simple and complex t-sql puzzles at

    http://msbiskills.com/tsql-puzzles-asked-in-interview-over-the-years/

    This blog is useful for mid level developers , Strictly not for SQL Experts 🙂

    Enjoy...

    The problem with such puzzles are the restrictions. For example, the hierarchical problem restricts to SELECTs and CTEs, which is not a high performance solution in this case. They also seem to promote the idea that "set based" means "all in one query", which is patently not true and seems to get people into a lot of trouble performance wise.

    Still, fun/intellectual stuff. Thanks for posting the link.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)