I have created query to delete rows from million rows table in my sql. the query is given below,
DELETE N
FROM table_a N
INNER JOIN table_b E ON N.form_id = E.form_id
AND N.element_id = E.element_id
AND E.element_type IN('checkbox','radio','select')
WHERE N.option_value = 0
ORDER BY id
LIMIT 1000;
When executing the above query. gets error.
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY id
LIMIT 1000' at line 7
How to fix this issue. I have used the reference Deleting millions of rows in MySQL