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 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, I'm hating Javascript right now, and I hope someone can help me. I
Right now I have a silverlight app that gets data from a mvc site.
Okay so I have a file with a bunch of digits 002003005\n 001001\n and
Okay, here is my situation: I'm looking for the best design approach. I'm working
Okay, so I'm trying to create a list of he folders, and sub-folders and
Okay, got a question. I have assembled a bit mask for options. Basically my
Okay what I want to do is something like this. |--> Child 1 (Parent=Root
I had the debugger working in pgAdminIII at one point, some time before upgrading
I was very surprised to get this error today, as it's one that I've
Is it normal behavior for FBConnect to always switch to the Facebook Application or

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.