Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update single column from another table
Message
De
28/11/2001 14:53:21
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00587103
Message ID:
00587145
Vues:
19
>Thanks Jay! The results are exactly as I wanted!
>
>>>Max --
>
>>>You need to add a SQL 89 join condition to the UPDATE to join the table and >>temporary query together, as follows:
>
>
>>>SELECT emp_name, commission, rptdate ;
>>> FROM Table1 INNER JOIN Table2 ;
>>> ON Table1.emp_name = Table2.emp_name;
>>> WHERE Table1.rptdate = Table2.rptdate;
>>> ORDER BY Table1.emp_name;
>>> into cursor crsTemp
>
>>>UPDATE Table2 SET Table2.commission = crsTemp.commission ;
>>> WHERE Table1.emp_name = Table2.emp_name;
>>> AND Table1.rptdate = Table2.rptdate
>
>
>>>Jay

Glad that worked! I've got a headache today, and have a bit of tunnel vision. As Robert mentioned, the UPDATE as shown above should work by itself without the intermediate query.

Jay
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform