Bonjour !!
-----------------------------
| CUR | NOM | CUR_NOUVEAU |
-----------------------------
| CUR1 | NOM1 | |
| CUR2 | NOM1 | |
| CUR3 | NOM1 | CUR_NEW_3 |
| CUR4 | NOM1 | CUR_NEW_4 |
-----------------------------
Comment faire un update pour obtenir les données ci dessous :
-----------------------------
| CUR | NOM | CUR_NOUVEAU |
-----------------------------
| CUR1 | NOM1 | CUR_NEW_3 |
| CUR2 | NOM1 | CUR_NEW_4 |
| CUR3 | NOM1 | CUR_NEW_3 |
| CUR4 | NOM1 | CUR_NEW_4 |
-----------------------------
La difficulté est la suivante
Comment faire un update en fonction du nom ..?
Il ne faut pas que la ligne CUR2 est un CUR_NOUVEAU=CUR_NEW_4.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 UPDATE table t1 SET CUR = SELECT CUR_NOUVEAU FROM table t2 WHERE t1.nom = t2.nom
Merci pour vos réponses !
Partager