There are 2 columns in the table, in one key and in another, its value(paramname, paramvalue).And the whole thing is connected with users.Each user has several parameters(I know, this is not the best option, but this is an old system).Question how to make an update so that set paramvalue=0 where paramname='a' only if it has paramname='b'and paramvalue ='1231'?
or is it easier to delete the database: D

1 Answers 1

UPDATE `table` AS` t1`
  JOIN `table` AS` t2`
    ON `t2`.`user_id` =` t1``u.user_id`
      AND `t2`.`param` =: param2 AND` t2`.`value` =: value2
      AND `t1`.`param` =: param1
  SET `t1`.`value` =: newValue1