Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query help

Status
Not open for further replies.

DotNetGnat

Programmer
Mar 10, 2005
5,548
IN
Hello All,

I have a table as shown below:
Code:
trackid    | beginAt | endAt
_____________________________
track1     |  0      | 1.55
track1     |  1.55   | 2.20
track1     |  2.20   | 3.25

track2     |  0      | 0.55
track2     |  1.05   | 1.80

track3     |  0      | 2.21
track3     |  2.15   | 2.80
track3     |  3.20   | 3.25
All tracks identified by trackid begin at 0 and can have number of segments and the end of the track is identified by the highest endAt number.

I want help with writing a query that identifies the breaks in the segments...for example...track1 is fine and has no problems and no breaks, ending point is the same as next beginning point...

but for track2 and track3 there are breaks as ending point is not same as the beginning point...

thanks in advance...

-DNG
 
i guess i have figured it out with a subquery...

thanks for looking...

-DNG
 
thanks Dagon. I am definitely looking for other options...I am trying to come up with an efficient query since the table has millions of records...I am not sure how efficient is a subquery...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top