I am working with a large database with over 1,000 products. Each product has an SKU code. I have am developing a script where certain products are removed depending on the first two and last two characters. I was wondering if there was a quick way to do delete these using MySQL only.
Is there a way I can use the WHERE statement to search for values that start with “XX” and end with “XX”?
If not then I don’t mind doing it the good old PHP way, I just think a MySQL way would be more effiencient.
Many Thanks,
Peter
That’s a simple delete statement
if you want products, which either start with XX or end with XX use an or condition
See SQL Fiddle for testing.