• SilverBack (4/29/2016)


    There are no Dups in the original database as all of these are considered Key Values,

    how would you begin to eliminate the dubs if they are key values.

    Luis Cazares (4/29/2016)


    Review which table is causing the dupes and remove them there before doing the join. In other words, use a subquery or temp table if necessary.

    Check Date is the same for all rows because it's not correlated to the main query.

    My first question is are you sure the data is truly duplicated and not simply new data that doesn't have enough attributes to differentiate itself between entries?

    Under the assumption that you do indeed have duplicated data, here's some pseudo code I use to pull out the dups. Depends on whether you want the minimum entry or the max entry.

    SELECT t1.MyID, t1.Column1, t1.Column2

    FROM Table t1

    INNER JOIN (SELECT MIN(MyID) AS MyID, Column1

    FROM Table

    GROUP BY Column1) t2

    ON t1.Column1 = t2.Column1

    AND t1.MyID = t2.MyID

    This helps me get the distinct record and the key value from the table in question. So for your Member table, you'd do a MIN or MAX on memid and use fullname where I have Column1.

    Does that help?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.