• A join will not work, as it cannot incorporate the logic that you need results sets in groups of 5.

    You can try to write a LEFT OUTER JOIN, and then inspect the result set for missing rows, but it won't be easy.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP