mysql - Probleme white UPDATE and IF (Select) -


with mysql i've tried :

update modepaiement set emplacement =     if((select emplacement escompte emplacement = 4)     or     (select emplacement modepaiement emplacement = 4),     13,     11)     id = 1 

but receive error can't use modepaiement in select part...

if replace modepaiement other table work fine...

maybe because update in modepaiement table...

is there way ?

http://sqlfiddle.com/#!9/2c710e/1

update modepaiement  left join (select emplacement        modepaiement emplacement = 4      union      select emplacement        escompte emplacement = 4) t on 1   set modepaiement.emplacement = if(t.emplacement null,11,13) id = 1 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -