• First off, I love this article.

    On Sign Reversals section, imagine that entry 7 & 8 were $500 instead of $400. :

    UNION ALL SELECT 500, '+' -- [Assigned ID is 10007]

    UNION ALL SELECT -500, '-' -- [Assigned ID is 10008]

    The routine fails to note that the combinations where could be off by the ($800 - $500) entries.