Results 1 to 2 of 2
  1. #1
    Skhaliq is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    7

    Delete Duplicate Records from SQL Date

    i have a table in which we are appending data on daily basis. we want to take all those record which have some changes. no need to store unique record. so we want a query which can be delete all those which are duplicate.


    our SQL table is :

    NewCode Outlet_Name Outlet_Location Outlet_Location_Text Loc Updated Date
    122 KAMAL BAKERY 5K GREEN DISTRIBUTION - KARACHI KHI 8-May-17
    445 BOLAN ICE DEPOT W3 EGC Distributor KHI 8-May-17
    450 CAFE MERHABA W3 EGC Distributor KHI 8-May-17
    122 KAMAL BAKERY 3K SHOAIB KHALIQ KHI 9-May-17
    445 BOLAN ICE DEPOT W3 EGC Distributor KHI 9-May-17
    450 CAFE MERHABA W3 EGC Distributor KHI 9-May-17




    After Removing Duplicates:



    NewCode Outlet_Name Outlet_Location Outlet_Location_Text Loc Updated Date
    122 KAMAL BAKERY 5K GREEN DISTRIBUTION - KARACHI KHI 8-May-17
    445 BOLAN ICE DEPOT W3 EGC Distributor KHI 8-May-17
    450 CAFE MERHABA W3 EGC Distributor KHI 8-May-17
    122 KAMAL BAKERY 3K SHOAIB KHALIQ KHI 9-May-17

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    create a make table query, and set to UNIQUE ROWS=true. (no duplicates)
    make the new table
    rename the old one
    rename the new one to the old one.

    you can avoid appending duplicates buy running 2 queries to import
    Q1 is an outer join that joins the new data to the old to see what already exists, so only add the new records.
    Q2 is an update. update all records from the new data.

    no more duplicates.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 12-13-2016, 09:48 AM
  2. delete duplicate records
    By Jen0dorf in forum Access
    Replies: 9
    Last Post: 10-21-2016, 06:55 PM
  3. Delete duplicate records
    By samdahlr in forum Access
    Replies: 8
    Last Post: 07-28-2014, 08:25 AM
  4. Replies: 3
    Last Post: 05-03-2011, 01:36 PM
  5. Delete duplicate records
    By Zukster in forum Queries
    Replies: 1
    Last Post: 08-26-2009, 03:14 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums