Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using LEFT JOIN
Message
 
À
04/08/2007 13:56:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01245960
Message ID:
01245965
Vues:
23
>Hi,
>I am trying to import customer data to my table. Customer provided me description as data, however my data design is using surrogate key. Therefore I need to do some works.
>
>Customer Master Table - ItemCode, GroupDescr, CateogryDescr
>Expected Table - ItemCode, GroupID, CategoryID
>
>GroupID/Category could be empty. Therefore, I use LEFT JOIN as below.
>
>
SELECT m.*, g.GroupID ;
>FROM MasterTable m LEFT JOIN Groups g ON m.GroupDescr = g.Descr ;
>INTO CURSOR mycursor
>
>Don't know why, after run this SQL, duplicated record exist in new resultset.
>
>Any ideas?
>
>Thank you

Run this and you will find out why:
SELECT *;
FROM MasterTable m;
     LEFT JOIN Groups g ON m.GroupDescr = g.Descr ;
INTO CURSOR mycursor
My guess is that you have more that one Descr matched in Groups table.
Check also SET ANSI in HELP.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform