Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL JOIN
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00155673
Message ID:
00155808
Vues:
21
>>>Good morning all,
>>>
>>>I have 2 tables I wish to join. They both have the same structure, but the conditions they were created with are different. Here's the statement I use:
>>>
>>>select distinct exp_1, ass_sclass, Customer.cnt, TP.cnt ;
>>>from customer full join TP ;
>>>into table category
>>>
>>>I get a syntax error when I try to run the program, but according to the help file, syntax is correct. Any thoughts??
>>>
>>>TIA
>>
>>Hmmm, after looking at Help file, it seems to indicate ON condition is optional. However, I tried an example on my tables using your syntax and it reported a syntax error. But when I included the ON condition, the syntax error disappeared.
>>
>>Bill
>
>Thanks Bill,
>
>The whole thing is joining both tables period. I put in a condition for the join, now I get this error "Field_1 is not unique and must be qualified." I think I may have to just nest a couple of loops to get it done.

You still need to tell the parser which fields you are joining the tables on using the ON clause.

The "Field_1 is not unique..." error just means that you add the table alias because more than one table in the join has that field name and the parser can't determine which table to use, so just use:

MyAlias.Field_1

in the expression where "MyAlias" is the alias of the table you want to capture the data for Field_1.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform