How to delete rows in mysql with specific text?

by raphael_tillman , in category: MySQL , 10 months ago

How to delete rows in mysql with specific text?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by edmond_brakus , 10 months ago

@raphael_tillman 

To delete rows in MySQL with specific text, you can use the following SQL query:

1
DELETE FROM table_name WHERE column_name = 'your_text';


Replace table_name with the name of your table and column_name with the name of the column where you want to search for the specific text. Also, replace 'your_text' with the specific text you are looking for.


For example, if you have a table called "users" with a column named "name" and you want to delete rows where the name is "John", you would use the following query:

1
DELETE FROM users WHERE name = 'John';


Please note that this query will delete all rows that match the condition. So, make sure to double-check your query before executing it.