0

delete all customers with email ending with example.com using mysql with specific DATE period from 9/15/2018 to 9/28/2018

2

Something like this:

delete customers
where email like '%example.com'
and date_created between '2018-09-15' AND '2018-09-28';

But first, run a select to see if it will delete the correct rows:

select * from customers
where email like '%example.com'
and date_created between '2018-09-15' AND '2018-09-28';
  • 1
    The CASTing is unnecessary. – Rick James Oct 11 '18 at 18:14
  • @RickJames Thanks Rick. I admit, it was a copy/paste from another example. – Kevin Bott Oct 12 '18 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.