Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UPDATE the same field twice in one statement
Message
 
 
À
07/11/2009 13:08:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01433681
Message ID:
01433686
Vues:
41
The correct (working) way to do that
UPDATE mytable ;
		SET myfld1 = (SELECT MAX(myfld1) FROM mytable WHERE Pk = nPkValue)  - nValue1 + nValue2 ;
	WHERE Pk = nPkValue
>How come I didn't think of that? <g> Thank you very much.
>>You can do it in one update
>>
>>
>>UPDATE MYTABLE SET MYFLD1 = MAX(MYFLD1 - nValue1) + nValue2 WHERE Pk = nPkValue
>>
>>>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform