• table scripts, sample data and expected outputs would be VERY helpful here. And if you want good performance too please include index scripts and numbers of rows per table. Thanks!

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service