I am not able to delete a row from a database object. In my case db object is having self indexing.  

A field root\_id is having a foreign key relation with key\_id (Primary key). The referential integrity is designed as `ON UPDATE NO ACTION AND ON DELETE NO ACTION`. Even still I am not able to delete.

```
CONSTRAINT `fk_MyTab` FOREIGN KEY (`root_id`) REFERENCES `MyTab` (`key_id`) ON DELETE NO ACTION ON UPDATE NO ACTION)

```

I have to delete records from this table `WHERE key_id = root_id`.  

When I try to delete I am getting the following. 

> 
> Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails (`MyTab`, CONSTRAINT `fk\_MyTab` FOREIGN KEY (`root\_id`) REFERENCES `MyTab` (`key\_id`) ON DELETE NO ACTION ON UPDATE NO ACTION)
> 
> 
> 

Point me to the right direction.