Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL JOIN to Update
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01113543
Message ID:
01113553
Vues:
16
Thanks! Worked fine.

>:o))
>
>UPDATE Temp3 SET ClientName = ALLTRIM(Client.ClientId) + " - " + Client.Cl_Name
>       WHERE Temp3.ClientId = Client.ClientId
>
>** or
>UPDATE Temp3 SET ClientName = ALLTRIM(Client.ClientId) + " - " + Client.Cl_Name
>       FROM Temp3 INNERT JOIN Client ON Temp3.ClientId = Client.ClientId
>
>** or if you want all fields in table3 to be updated, no metter if there are macthing records in Client (i doubt about it)
>UPDATE Temp3 SET ClientName = NVL(ALLTRIM(Client.ClientId) + " - " + Client.Cl_Name, '')
>       FROM Temp3 LEFT JOIN Client ON Temp3.ClientId = Client.ClientId
>
>
>
>
>
>>I'm using VFP9.
>>
>>Corrected:
>>
>>
>>SELECT Temp3
>>SCAN
>>				
>>    =SEEK(Temp3.ClientId, "Client", "ClientId")
>>
>>    REPLACE IN Temp3 ;
>>       ClientName WITH ALLTRIM(Client.ClientId) + " - " + Client.Cl_Name
>>       NEXT 1
>>
>>END SCAN
>>
>>
>>
>>>>How can I use a JOIN to update instead of:
>>>>
>>>>
>>>>SELECT Temp3
>>>>SCAN
>>>>				
>>>>    **=SEEK(TempJoin.ClientId, "Client", "ClientId")
>>>>    =SEEK(Temp3ClientId, "Client", "ClientId")
>>>>
>>>>    REPLACE IN Temp3 ;
>>>>       ClientName WITH ALLTRIM(Client.ClientId) + " - " + Client.Cl_Name
>>>>       NEXT 1
>>>>
>>>>END SCAN
>>>>
>>>
>>>Hey, from where TempJoin comes from?
>>>BTW what version of VFP you use?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform