Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6033121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:26:15+00:00 2026-05-23T05:26:15+00:00

I am recording the changes made in a directory. That directory has a lot

  • 0

I am recording the changes made in a directory. That directory has a lot of files so I am trying to reduce the size of my database by deleting duplicates. But to make things clear let me show you what I have.

I have a table named table1

enter image description here

from looking at this table I can tell that the first time I scanned the directory I had two Files A and B. The next time I scanned the directory I know that I have added file C and modified file A by looking at the table. note that file A has a different DateModified that’s why I can tel it’s been modified. Lastly on my last scan I know that file X has been created and also that file B has been modified. File A and C stayed the same.

After creating a lot of scans there are several files that get repeated. If they have a different DateModified I don’t want to remove duplicates because I want to track changes on that directory. Moreover when removing duplicates I want to stay with the lower DateInserted so that I can know when it was modifies.

So in other words I want to build a query where I can remove FileID 6 because FileID 3 contains the same path and same DateModified. I will also like to remove FileID 4 because fileID 2 cointains the same two records. And lastly I will like to remove fileID 5 for the same reason. How could I build this query?

EDIT

I am just adding the query that I have been working with hoping it can help.

enter image description here

with this query I know that those are the files that repeat based on the criteria that I need. I don’t know how to go from there and delete the higher dateInserted duplicated based on those results. Hope this helps

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:26:16+00:00Added an answer on May 23, 2026 at 5:26 am

    If I understand right, you want unique records where a unique record qualifies as a distinct Path & DateModified combination, and when duplicates occur you want the earliest record returned.

    This query should hopefully do the trick:
    SELECT MIN(FileID) AS FileID,Path,datemodified,dateInserted FROM table1 GROUP BY Path,DateModified

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a button that changes the background drawable on different states, this way:
Using a trigger-based approach to audit logging, I am recording the history of changes
I am trying to use the Sharp-shooter Silverlight report viewer control. This control has
Greetings great SO comrades; I'm trying to use this code to make changes to
My MVC application has worked fine for over a year, but it has now
I am designing a database where I wish to track changes in my tables,
While trying to revert a commit I made to my repository of my .emacs.d
I have searched a lot regarding my problem but no solution so i am
It was working before and maybe someone made changes to the code and I
i have an issue regarding UitableViewCell. the issue is that i have made a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.