I am trying to configure deleting rows from a table by the value of a non-key column (values ​​in it can be repeated, but this is acceptable).

I know that in the safe mode of MySQL Workbench, the tables in MySQL change only in the key columns, therefore, a little googling, I tried to cheat and make a subquery to the same table.

delete from tcontrol where id in ( select * from (select id from tcontrol where name like '123') t ); 

MySQL Workbench still swears at this and claims that it cannot do this in a safe deletion mode. Disable this mode do not want.

Is there any workaround?

  • My first comment was the height of stupidity, I will try to rehabilitate myself: what's the problem with the simple DELETE FROM tcontrol WHERE name LIKE '123' ? - etki
  • In the same. The name column is not a key, therefore Error code 1175. - Mr Scapegrace
  • @Etki apparently, in safe mode (which I learned about 7 minutes ago), you can't do that. It is not clear why to use it and at the same time try to bypass it. It's easier then to turn it off. - Regent
  • Are you an hour from a mysql workbench? - etki
  • one
    Hour yes. Cut down safe mode, now it worked in the simplest (your) version. I don't know what the consequences will be. - Mr Scapegrace

0