Home Forums SQL Server 2008 T-SQL (SS2K8) Is a Dynamic SQL solution possible in this case ? RE: Is a Dynamic SQL solution possible in this case ?

  • There's no need to use dynamic code. Here's one option and maybe someone could give a better one because I'm not so sure on its performance with big loads. It's quite simple though. 🙂

    SELECT MYID,

    TITLE

    FROM #Temp

    GROUP BY MYID,

    TITLE

    HAVING COUNT(*) = (SELECT COUNT( DISTINCT ID) FROM #Temp)

    ORDER BY MYID,

    TITLE

    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