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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:42:58+00:00 2026-06-15T15:42:58+00:00

I have some 30000 rows in the table with the timestamp for every 10

  • 0

I have some 30000 rows in the table with the timestamp for every 10 mins and with some 20 columns.

timestamp  Col1 Col2 Col3 ... col20

timestamp would be like every 10 mins. ex: 18-05-2012 20:07, 18-05-2012 20:17, 18-05-2012 20:27

Columns have integer or float data.

My question is: I need to find the gaps and time duration which the data has been not recorded in the columns. Suppose the column has Value, NULL, NULL, Value, Value, NULL. And it has the respective timestamps.

I need the output like as starttime and endtime of NULL values and duration (starttime – end time).

  • 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-15T15:42:59+00:00Added an answer on June 15, 2026 at 3:42 pm

    Okay, as I understood it now, you want the timedifference between the rows where in any column something was not recorded, right?

    Then have a try with this:

    SELECT
    yt1.[timestamp] AS StartTime,
    MIN(yt2.[timestamp]) AS EndTime,
    DATEDIFF(s, yt1.[timestamp], MIN(yt2.[timestamp])) AS DifferenceInSeconds
    FROM
    yourTable yt1
    LEFT JOIN yt2 ON yt1.[timestamp] < yt2.[timestamp]
    WHERE
    yt1.Col1 IS NULL
    OR yt1.Col2 IS NULL
    ...
    OR yt1.Col20 IS NULL
    OR yt2.Col1 IS NULL
    ...
    OR yt2.Col20 IS NULL 
    GROUP BY yt1.[timestamp]
    

    To be honest, I’m not sure if this works, since you didn’t provide sample data to play around a bit.

    To get the time difference in hh:mm:ss format search questions on stackoverflow, for example this one.

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

Sidebar

Related Questions

I have an XML structure like the following: <tables> <table name=tableName1> <row ID=34 col1=data
I have some text lines like that : vt_wildshade2^508^508 vt_ailleurs2^1188^1188 ... vt_high2^13652^13652 Is it
I have some tables roughly like so: Client: id name Employee id name Email
I have some table: Title 1 | Title 2 | Title 3 | --------------------------------------------------
I have a table with about 100.000 rows that used to look more or
I have more than 30,000 rows in a table. It takes a lot of
I have a table containing a large number of rows. Each row has 2
I would like simply delete some polygons from a SpatialPolygonsDataFrame object based on corresponding
I have a table containing a large number of rows. Each row has 2
I have a JTable where I want to highlight some rows using a custom

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.