DotNetGnat
Programmer
Guys, I have previously posted this question on the wrong and was directed here...
I need help in writing a query on the table shown below.
For each distinct Route:
1. The query should find out if there are any overlapping values(either in the left or right values) in the segments as shown above for the RouteId 2000.
2. The query should find out discrepancies in the increasing left or right values. The values should increase from one segment to the next unlike as shown above for the RouteId 3000 in red.
thanks
-DNG
I need help in writing a query on the table shown below.
Code:
Table1
________
SegmentId | RouteId | LeftFrom | LeftTo | RightFrom | RightTo
______________________________________________________________
1 | 1000 | 5001 | 5469 | 5000 | 5468
2 | 1000 | 5471 | 5885 | 5470 | 5886
3 | 1000 | 5887 | 6001 | 5888 | 6000
5 | 2000 | 391 | 489 | 390 | 488
6 | 2000 | 491 | [red]521[/red] | 490 | 520
7 | 2000 | [red]521[/red] | 601 | 522 | 600
8 | 2000 | 603 | 699 | 602 | 698
9 | 3000 | 10031 | [red]10211[/red] | 10030 | 10210
10 | 3000 | [red]10201[/red] | 10419 | 10312 | 10418
For each distinct Route:
1. The query should find out if there are any overlapping values(either in the left or right values) in the segments as shown above for the RouteId 2000.
2. The query should find out discrepancies in the increasing left or right values. The values should increase from one segment to the next unlike as shown above for the RouteId 3000 in red.
thanks
-DNG