i'm looking simple way update on table if there no other columns present in same table same value i'm trying update, ideally in single query. far i'm getting error you specify target table 't1' update in clause
. here tried in few variations far (still unable working):
update emailqueue t1 set t1.lockedon = 1470053240 (select count(*) emailqueue t2 t2.lockedon = 1470053240) = 0 , t1.lockedon null
in mysql, need use join
. in case, left join
in order:
update emailqueue eq left join emailqueue eq2 on eq2.lockedon = 1470053240 set eq.lockedon = 1470053240 eq.lockedon null , eq2.lockedon null;
Comments
Post a Comment