What's the command to achieve this:
MYSQL: delete all rows containing string "foo"
in table "bar"
The truncate command removes all rows of a table.
Here, ON DELETE CASCADE is added because when any row is deleted in one table the same gets deleted in the foreign referenced tables that are referencing the primary key in that table. Step-4: Verifying the database : To view the description of the tables in the database using the following SQL query as follows.
DELETE FROM bar where field1 like '%foo%' OR field2 like '%foo%' OR ... fieldLast like '%foo%'
You'll need to explicitly list the columns I think, so something along the lines of...
DELETE FROM bar WHERE col1 LIKE '%foo%' OR col2 LIKE '%foo%'....etc
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