Union Query with 'duplicates'

  • It depends :hehe:

    I had the same question and ran queries on tables with over 9million rows on SQL Server 2005 and 2008 (I used mine and Chris, I should have tested Eugene's as well).

    In 2005 both queries performed pretty much the same way.

    In 2008 the single COUNT option was at least twice faster than the pre-aggregate solution.

    That was on the messy tables I have here, but someone could help me to create a good test environment.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply