Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183

    Angry Unanswered: Duplicates everywhere

    HI guys, I know this happens a lot, and I have read some of the posts but mine seems to be a lot more complicated.

    There is the main database and then tables from this database are also linked to table with the same name in smaller (lookup databasese).
    Each of these tables with duplicates has an ID-primary number set to AutoNumber so in a way they are not duplicates,but they really are and a lot of them.

    "Select distinct" does not help in my case and plus all these tables interact as there are values from those table all over the database and other tables,so I can just delete certain duplicates as some of them have a full record agains them and then some of them are completely empty.

    So I need to identify all the duplicates throughout multiple tables that are "talking" to earch other and delete them but without obviously losing data from the database.

    Is there a way I can create a good sql query that links all of those tables and deletes duplicate records.

    Any help would be great as this database is horrible and I have the job of fixing it all up.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Did you try to use the wizard t create a query which searchs for duplicates? Use

    PHP Code:
     SELECT  DISTINCTROW yourFields
        FROM  yourTable
          GROUP BY fieldsItmightBeDuplicated
             HAVING  Count
    (*)>

  3. #3
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183
    My problem so much is not to identify the duplicate records, but more, once identified how to correctly delete all the data and update linked tables correctly as well so I don't end up losing.

    What I mean by that.

    Lets say I have ten duplicate records, 9 of them are created but have no data entered and one is a proper record,all the fields are filled in.

    You know, I don't want to delete that one where all the data is...

  4. #4
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Marked for deletion.
    Last edited by r123456; 11-20-04 at 09:02.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •