Deleting Data from Database Tables

14 February 2012 By Nithya Vasudevan 213 views No Comment
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×

Delete Rows in a table

The DELETE statement is used to delete rows in a table.

DELETE FROM table_name [WHERE condition] [ORDER BY column_name]
[LIMIT row_count]

The WHERE clause specifies which record or records that should be deleted. If you omit the WHERE clause, all records will be deleted!

If the ORDER BY clause is specified, the rows are deleted in the order that is specified.

The LIMIT clause places a limit on the number of rows that can be deleted.

Delete All Rows

It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:

DELETE FROM table_name


DELETE * FROM table_name

Tags: , , , , , ,