Reputation: 32321
I have a Table by name Persons
My requirement is that , i need to check if there exists any records inside Persons table with PersonID = 1 and so if exists delete it
I have tried as
DELETE FROM Persons
WHERE PersonID = 1
AND EXISTS(SELECT PersonID FROM Persons WHERE PersonID = 1 LIMIT 1)
I am getting the following error
http://sqlfiddle.com/#!9/ab2b51
could you please tell me how to fix this
Upvotes: 0
Views: 28
Reputation: 74
There is no need for such trouble, just do "DELETE FROM Persons WHERE PersonID = 1"
Upvotes: 1