1

Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.

DELETE e1
FROM employeedetail AS e1
INNER JOIN employeedetail AS e2 ON e1.email = e2.email AND e1.id < e2.id;

i tried this

Reporter
  • 3,897
  • 5
  • 33
  • 47
  • you didn't specify what to delete try using where – JFeel Jun 20 '23 at 06:15
  • You should tell us what RDBMS you use (even if we can guess it's mysql). The error message is extremely clear : did you forget to add a WHERE to your query or is it intended ? You could also replace your INNER JOIN by a WHERE doing the same thing, or add a dummy WHERE but does not restrict anything, or disable safe mode... – AFract Jun 20 '23 at 06:18
  • Did you **read** that error message? – Nico Haase Jun 20 '23 at 06:22
  • https://meta.stackoverflow.com/questions/388759/why-should-i-tag-my-rdbms – Reporter Jun 20 '23 at 07:27

1 Answers1

1

Are you using MySQL?This error is usually caused by MySQL's Safe Update Mode.When secure update mode is enabled, the UPDATE statement must include a WHERE clause, and the primary key or unique index column of the table must be used in the WHERE clause.

You can Disable secure update mode.SET SQL_SAFE_UPDATES = 0; or add the appropriate WHERE clause in your UPDATE statement.

You can refer to this article MySQL error code: 1175 during UPDATE in MySQL Workbench

lant
  • 391
  • 2
  • 10