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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:22:58+00:00 2026-05-16T15:22:58+00:00

Okay so right now I’m working on a program that has a whole bunch

  • 0

Okay so right now I’m working on a program that has a whole bunch of event objects. Each event object has a start time and end time (both full timestamps). A lot of the events are contiguous (one event’s endTime is the same as the next event’s startTime) showing that the two events happened in succession. If I were to store all my events in a SQLite or MySQL table, would it be possible to query for each set of contiguous events?

Say my table looks like this.

id   title          start_time           end_time
----------------------------------------------------------
1    Happy Time     4/3/2010 10:00:00    4/3/2010 13:00:00
2    Happier Time   4/3/2010 13:00:00    4/3/2010 18:00:00
3    Good Time      4/4/2010 18:00:00    4/4/2010 19:00:00
4    Gooder Time    4/4/2010 19:00:00    4/4/2010 22:00:00
5    Sad Time       4/6/2010 16:00:00    4/6/2010 20:00:00

I want to be able to query this table and see that id 1 and 2 are contiguous, id 3 and 4 are contiguous and id 5 is… contiguous with itself.

The reason I don’t know where to start is because whenever I have worked with SQL queries, results were returned as individual rows. One row in the result is never part of a subgrouping.

If you have any questions feel free to comment. Thanks!

  • 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-16T15:22:59+00:00Added an answer on May 16, 2026 at 3:22 pm
    SELECT a.id, a.title, a.start_time, a.end_time, b.id, b.title, b.start_time, b.end_time
    FROM TABLE1 a, TABLE1 b
    WHERE a.start_time = b.end_time
    

    EDIT: modified based on the additional information:

    SELECT a.id, a.title, a.start_time, a.end_time, b.id, b.title, b.start_time, b.end_time
    FROM TABLE1 a left join TABLE1 b ON a.start_time = b.end_time
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I'm making a table right now for Box Items. Now, a Box
Okay so im working on this php image upload system but for some reason
Okay, here's the scenario. I have a utility that processes tons of records, and
Okay, we know that the following two lines are equivalent - (0 == i)
Okay, I've looked all over the internet for a good solution to get PHP
Okay, so I'm running a small test webserver on my private network. I've got
Okay, I've seen but haven't programmed in C# before. You can assume I'm competent
Okay, so this probably sounds terribly nefarious, but I need such capabilities for my
Okay. I know this looks like the typical Why didn't he just Google it
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My

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.