• Rick Lang (6/21/2010)


    Perhaps a different version of the question where the answer would be different with the Having clause vs just the where clause might help to clear up any confusion (mine anyways)?

    If you go back to page 4, you will see that I posted a script to create and populate the table. Copy and paste it into SSMS, run it, then try changing things and see how that affects the results.

    If you then still have questions, feel free to ask!


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/