Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL to find gaps
Message
From
18/01/2000 18:29:59
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL to find gaps
Miscellaneous
Thread ID:
00319662
Message ID:
00319662
Views:
52
Anybody got any spiffy tricks to find the gaps in a range using SQL?

Say I've got a table with:
Start   End
    1     5
    6     8
   12    15
   19    24
I'd like to find the gaps (9-11,16-18). One other thing, I'd also like to be able to give it some limits like "find the gaps between 10-17" so it should return 10-11, 16-17, in that case. Or do I have to do this by just brute force, since I need to look at 2 records at a time?

TIA
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Next
Reply
Map
View

Click here to load this message in the networking platform