I have some rows in my table that I need to delete.
The rows that must be delete all have strings with two "***" in them, for example "This is a ***example of *** a bad row".
How can I SELECT these rows, so I can check them out and delete them afterwards?
I know I can use SELECT * FROM table WHERE column LIKE '%***%' but that also selects the rows with just one "***" in them (the rows that must be deleted have two "***" in them).
Thanks!
SELECT * FROM table
WHERE column LIKE '%***%***%'
This will, however, also delete any rows where there are three or more "***". If you don't want that, you can do
SELECT * FROM table
WHERE column LIKE '%***%***%'
AND column NOT LIKE '%***%***%***%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With