dimanche 11 octobre 2020

MySQL IF statement with BETWEEN operator, not showing as valid

Can someone tell me what is invalid about this statement? I haev tried a few different varations of this but none show as valid. I have checked SO and it says it should be valid but is not. Is it due to the BETWEEN condition?

UPDATE mytablename SET column_2 = IF({BETWEEN '1' AND '2'}, {new_value}, field_1) WHERE id=1

UPDATE mytablename SET column_2 = IF(column_1== 1{BETWEEN '1' AND '2'}, 1{12}, field_1) WHERE id=1

Aucun commentaire:

Enregistrer un commentaire