Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Child Records
Message
From
07/05/2002 21:34:20
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00653805
Message ID:
00653814
Views:
25
I'd be interested in your test results. Now that I think about it a bit more, the FOR condition should be Rushmore optimizable so there may not be a big difference.

>I think, we have to test this statement. It seems right logically, but not necessary might be true...
>
>BTW, as I understood, we have related tables...
>
>I'll run some tests later tonight...
>
>>The COUNT() example will be faster (assuming there is an appropriate index) to first SEEK() and then do a COUNT WHILE instead of FOR. As I recall the FOR condition will read all the records in the table - the WHILE will only read until the condition is no longer true - less records to read.
>>
>>>>I have two tables related together and want to be able to count the number of associated child records whenever I move the pointer in the parent table.
>>>>
>>>>How do I do this?
>>>>
>>>>Thanks!
>>>
>>>Use either Select SQL (if tables unbuffered) or count, e.g.
>>>
>>>select child
>>>lnRecno=recno()
>>>count for ChildID = m.lnParentID to lnChildren
>>>go to lnRecno
>>>select Parent
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform