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 7791753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:59:13+00:00 2026-06-01T21:59:13+00:00

I have run into a situation where there is ‘bad’ data in a number

  • 0

I have run into a situation where there is ‘bad’ data in a number of tables. Data has been cross contaminated from various sources and I need to clean it out.

Specifically there are several hundred tables with identical definitions. They hold timed sensor data with an auto-increment column, Time/Date stamp and other data. The ‘bad’ data can be identified by time/date jumping backwards rather than growing as expected.

Example:

10 2010/01/05 
11 2010/01/06
12 2010/01/07
13 2008/05/09
14 2008/05/10
15 2008/05/11
16 2010/01/08
17 2010/01/09

Im looking for the best way to find these areas.

Some things to note:
– the tables in question have 100s of millions of records
– in my example the dates are sequential – in reality there may be 10 or 1000 entries for a given date (with timestamps on each) and then nothing for a week.

I can imagine a perl script walking through each and looking for these jumps. Im wondering if there is a faster, more sql-esque method.

  • 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-06-01T21:59:14+00:00Added an answer on June 1, 2026 at 9:59 pm
    select t.* from t, (select @maxDate := '') init
    where not if(date > @maxDate, @maxDate := date, 0)
    order by id
    

    This is the fastest way I can think of.

    NOTE: I’m assuming you’re expecting to get records with IDs 13, 14, 15 in your example.

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

Sidebar

Related Questions

I have run into a situation where I want to ensure that a compound
I don't know if you have run into a similar situation but here's a
I seem to run into this situation quite a lot and have yet to
I've run into a situation with loading content from an xml file. Basically there
I have frequently run into the situation where I want to update many records
I have a situation I've run into several times but have never found a
I run into this problem again and again; Situation there is a (large) dataset
Has anyone run into a situation where a WaitAny call returns a valid handle
I'm learning to use Grails and have run into a situation I don't understand
I have run into a 1-N situation. i.e 1 record in 1st table will

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.