Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joins
Message
De
06/09/2000 21:56:49
 
 
À
06/09/2000 21:13:59
John Tomblin
Service Station Systems, Inc.
San Jose, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Joins
Divers
Thread ID:
00413276
Message ID:
00413284
Vues:
21
>I am trying to get many fields from table A and if present, one field from table B, otherwise .Null. from table B. I always want all of the records that meet the where clause criteria from table A. That is the number of records I want no matter what table B has or doesn't have. I have tried every kind of join of table B and never get the correct number of records. The correct number of records is 74. Here are the results.
>
>No Join, all from table A - 74 records
>Join table B - 28
>left join table B - 87
>left outer join table B - 87
>right join table B - 28
>right outer join table B - 28
>inner join table B - 28
>from tableA, table B - 24,790
>where tableA.field = tableB.field - 28
>
>I want the 74 records every time and I can come up with no way to get them and only them. Can anyone help.

The LEFT JOIN is the way to go.
There is more than one record in B that matches A on the chosen field, so you will get those as well. Why do you not want the multiple matches?
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform