i can't seem to figure out how to combine LIKE with an OR or AND:
DELETE * FROM persons WHERE FirstName = 'Abe' AND LastName LIKE '%coln';
Looks like it should owrk to me but I get error 1064 (syntax0
Is there a correct way to do this?
i can't seem to figure out how to combine LIKE with an OR or AND:
DELETE * FROM persons WHERE FirstName = 'Abe' AND LastName LIKE '%coln';
Looks like it should owrk to me but I get error 1064 (syntax0
Is there a correct way to do this?
The problem is the asterisk. You don't use it on deletes since you can only delete whole records. Should be:
DELETE FROM persons WHERE persons.FirstName = 'Abe' AND persons.LastName LIKE '%coln';
Drop the *
DELETE FROM persons WHERE FirstName = 'Abe' AND LastName LIKE '%coln';