Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combining two tables in VFP 6.0
Message
De
08/07/2002 09:49:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
08/07/2002 09:39:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00676093
Message ID:
00676096
Vues:
12
>Hello Group,
>
>
>I am trying to insert new meetuniq values into the stusched table.
>The meetuniq field denotes a time,day of the week,and a specific schoolyear
>They are going from 8 meetuniqs per week at the local districts to 4 meetuniqs at
>the Career Center The meetuniqs at the career center are different for the same class
>and period, then those at the local district.
>
>I am trying to create a new table with the correct meetuiques for the career
>center.
>
>tmpStusched data ( temporary data from the home district )
>LastName FirstName SectionN Coursec
>Smith Joe 1 2T6
>Jones Jim 1 2T6
>LaFleur Karen 1 2T6
>
>I have created a table call CCmeetuniq with the following data
>
>meetuniq sectionN Coursec
>100056 1 2T6
>100057 1 2T6
>100058 1 2T6
>100059 1 2T6
>
>What would be the best way to create a table cisStucsched with the following
>data
>
>LastName FirstName meetuniq Section Coursec
>Smith Joe 100056 1 2T6
>Smith Joe 100057 1 2T6
>Smith Joe 100058 1 2T6
>Smith Joe 100059 1 2T6
>Jones Jim 100056 1 2T6
>Jones Jim 100057 1 2T6
>Jones Jim 100058 1 2T6
>Jones Jim 100059 1 2T6
>LaFleur Karen 100056 1 2T6
>LaFleur Karen 100057 1 2T6
>LaFleur Karen 100058 1 2T6
>LaFleur Karen 100059 1 2T6
>
>
>Thanks
>Jim
select tmpStusched.LastName, tmpStusched.FirstName, CCmeetuniq.MeetUniq;
  from TmpStusched, CCmeetUniq
Note the missing WHERE clause! Every record from Table1 will be combined with every record from Table2. This is called a Cartesian Product.

In most cases, this Cartesian Product is the result of a programming mistake - but sometimes, as here, it is required. Because the Cartesian Product is often the result of a careless mistake, you should include a comment, stating that it is on purpose.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform