Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 creating cursor
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00451015
Message ID:
00451019
Views:
21
A Cartesian product would actually be 96000*24000 which is 2,304,000,000.
There's just a lot of matches between table1 and table2 on the comp_no field, so your only getting 800k. :)

If you're looking for specific data in table2.name, you should add
where table2.name = lcSomeValue to the select.

>Hi All,
>
>I'm trying to create a cursor but keep getting a 'cartesian' join.
>
>Table1 has 96,000 + records.
>
>table2 has 24,000 + records.
>
>I want all the records in table one and I'm only looking for the data in a specific field of table2.
>
>The resultant table should include all the fields in table1 and only the table2.name field information.
>
>The comparable field in both tables is the comp_no field.
>
>Here's one of many miserable attempts.
>
>select tabel1.*, table2.name from table1, table2 where table1.comp_no = table2.comp_no into cursor tabletemp
>
>The above gives me 800,000 + records, I only want table1 records with the name field incorporated.
>
>I'd appreciate any help, guidance.
>
>TIA.
>
>Jim Harvey
>jharvey@netrax.net
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform