Welcome to Sign in | Help

Re: script de SELECT cu GROUP BY sql server 2000

  •  07-06-2007, 5:01 PM

    Re: script de SELECT cu GROUP BY sql server 2000

    Incearca

    SELECT t.LeadID, t.CompanyName
    FROM Table_1 t JOIN
    (SELECT CompanyName
    FROM Table_1
    GROUP BY CompanyName
    HAVING COUNT(CompanyName) > 1) x ON t.CompanyName = x.CompanyName

    *Table1 este tabelul "cu pricina".

    Ai indecsi pe acest tabel? Mie mi-a mers mai repede cu un "primary key" pe LeadID si un index pe CompanyName. 

View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems