We can use the DELETE statement and WHERE clause to delete specific rows in the MySQL table.
mysql> Select * from names; +------+-----------+ | id | name | +------+-----------+ | 1 | Rahul | | 2 | Gaurav | | 3 | Raman | | 4 | Aarav | | 5 | Ram | +------+-----------+ 5 rows in set (0.00 sec) mysql> DELETE from names where id = 4; Query OK, 1 row affected (0.07 sec)
The above query will delete a row with id = 4 from the table ‘names’.
mysql> Select * from names; +------+-----------+ | id | name | +------+-----------+ | 1 | Rahul | | 2 | Gaurav | | 3 | Raman | | 5 | Ram | +------+-----------+ 4 rows in set (0.00 sec)
The above is the detailed content of How can we delete a single row of data from a MySQL table?. For more information, please follow other related articles on the PHP Chinese website!