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

  • SEARCH
  • Home
  • 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 6688131
In Process

The Archive Base Latest Questions

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

On a old web app I had a table with the following structure: tools(id,

  • 0

On a old web app I had a table with the following structure:
tools(id, name, abbreviation, width, height, power, type)

The thing is that I need to add history support to the tools. The working scenario is that details of each tool can be modified, and I need to keep track of the changes. For example, if I need to see the details of a tool from a certain date from the past, how can I do that?

How the database have to looks?

  • 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-26T05:22:09+00:00Added an answer on May 26, 2026 at 5:22 am

    I would keep the same table, but add a dateEffective field, and then create a new row every time a tool changes. Then when querying the table, you can get the version of a tool at a given date using:

    SELECT * FROM tools WHERE id=@id AND dateEffective<@thisDate ORDER BY dateEffective DESC LIMIT (0,1)
    

    EDIT You may wish to create another field called toolVersionId as a primary key.

    EDIT 2 In response to your comment, how about:

    SELECT *
    FROM tools t1
    WHERE toolVersionId IN (SELECT toolVersionId
                            FROM tools t2
                            WHERE t2.id = t1.id
                            ORDER BY t2.dateEffective DESC
                            LIMIT (0,1)
                           );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an old web app written in classic ASP. We don't have the
I am working on an old ASP web app (not .net) and I need
I'm replacing an old web application with a new one, with different structure. I
So, we are migrating an old web app from a 32-bit server to a
For some strange reason, a five year old internal asp.net web app that is
I'm overseeing the overhaul an asp.old web app for order entry into .net. So
I'm having to work on an old web app that a previous developer left.
I have a bunch of code in my old Web Forms app I'm migrating
I have an old web app where Javascript is used to validate some dates.
I'm looking at an old web app I wrote and it is taking about

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.