dimanche 8 mars 2015

Use IF statement within update statement in SQL

In the following peace of code, I'm trying to use update value of table's col according to specific condition. but the syntax is not correct !. Is there an idea to update tables according a conditions ?



UPDATE table SET col=
IF (condition)
value1
ELSE
value2

Aucun commentaire:

Enregistrer un commentaire