Delete query not working in mysql
mysql, sql
Solution
You don't need to use the asterisk in a delete. Just do `DELETE FROM user_enrole` to delete all records.
If you want to delete specific records filtered by one or more conditions, you will specify those conditions in the `WHERE` clause, like so:
DELETE FROM user_enrole
WHERE somecolumn > 1
AND anothercolumn = 'Username'
Problem
I am trying to delete all records from a table called user_enrole.I am using this query ``` DELETE * FROM user_enrole ``` I think syntax of my query is not wrong but it is giving me error saying #1064 - 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 '* FROM user_enrole' at line 1 I have doubled check my syntax i am not able to figure out what is going wrong can someone point out please. Is it occuring because of the relationship this table has with use table or what?