Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Missing Items
Message
From
12/11/2003 15:36:18
 
 
To
12/11/2003 15:15:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00849206
Message ID:
00849254
Views:
26
AKhan --

Another approach would be to create a temporary table and generate records with the key values of the integers between and including the Start and End range points. Then do the query which Chuck identified.

Jay

>Thanks for the reply but table A has a range (with 2 columns Start and End. Example 1 50), your query would work if it had just items.
>
>Any other thoughts ???
>
>
>>>Hello all
>>>
>>>I have 2 tables,a and b and table a has a range of item numbers and table b has the actual items,how can i write a sql to pull all the missing items from table b.
>>>
>>>Example
>>>Table A
>>>------------------
>>>ItemBegin ItemEnd
>>>1 50
>>>
>>>Table B
>>>
>>>Items
>>>1
>>>2
>>>7
>>>9
>>>10
>>>
>>>I want the query to pull missing records as
>>>3-6
>>>8-8
>>>11-50
>>>
>>>Is it possible without writing a procedure ??
>>>
>>>Thanks
>>
>>
>>SELECT item FROM table_a WHERE item NOT IN (SELECT item FROM table_b)
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform