- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we delete a single row from a MySQL table?
We can use DELETE statement along with a WHERE clause, which identifies that particular row, to delete a row from MySQL table.
Example
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 query above will delete a single row having id = 4 from table ‘names’.
mysql> Select * from names; +------+-----------+ | id | name | +------+-----------+ | 1 | Rahul | | 2 | Gaurav | | 3 | Raman | | 5 | Ram | +------+-----------+ 4 rows in set (0.00 sec)
- Related Articles
- How can we delete multiple rows from a MySQL table?
- How can we delete all rows from a MySQL table?
- How can we fetch a particular row as output from a MySQL table?
- How can we insert a new row into a MySQL table?
- How to delete a single value from a MySQL table with duplicate records?
- Delete records from a MySQL table with IN() in a single query
- How to delete a row from a table using jQuery?
- Does deleting row from view delete row from base table in MySQL?
- How can you delete a table from a database in MySQL Python?
- What happens if I will delete a row from MySQL parent table?
- How can we delete a MySQL stored function from the database?
- How can we remove a column from MySQL table?
- How can you delete a record from a table using MySQL in Python?
- Can we update a row with the highest ID in a single MySQL query?
- How can we drop UNIQUE constraint from a MySQL table?

Advertisements