Syntax\n------\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] \n  FROM tbl_name [PARTITION (partition_list)]\n  [FOR PORTION OF PERIOD FROM expr1 TO expr2]\n  [AS alias]                    -- from MariaDB 11.6\n  [WHERE where_condition]\n  [ORDER BY ...]\n  [LIMIT row_count]\n  [RETURNING select_expr \n    [, select_expr ...]]\n\nDescription\n-----------\n\n| Option        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| LOW_PRIORITY | Wait until all SELECT statement are done before starting the statement. Used with storage engines that uses table locking (MyISAM, Aria etc). See HIGH_PRIORITY and LOW_PRIORITY clauses for details.                                                                                                                                                                                                                                                          |\n| QUICK         | Signal the storage engine that it should expect that a lot of rows are deleted. The storage engine can do things to speed up the DELETE like ignoring merging of data blocks until all rows are deleted from the block (instead of when a block is half full). This speeds up things at the expanse of lost space in data blocks. At least MyISAM and Aria support this feature. |\n| IGNORE        | Don't stop the query even if a not-critical error occurs (like data overflow). See How IGNORE works for a full description.                                                                                                                                                                                                                                                                                                                                      |\n\nFor the single-table syntax, the DELETE statement deletes rows from tbl_name and returns a count of the number of deleted rows. This count can be obtained by calling the ROW_COUNT() function. TheWHERE clause, if given, specifies the conditions that identify which rows to delete. With no WHERE clause, all rows are 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.\n\nFor the multiple-table syntax, DELETE deletes from each tbl_name the rows that satisfy the conditions. In this case, ORDER BY and LIMIT cannot be used. A DELETE can also reference tables which are located in different databases; see Identifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be deleted. It is specified as described in SELECT.\n\nYou cannot delete from a table and select from the same table in a subquery.\n\nYou need the DELETE privilege on a table to delete rows from it. You need only the SELECT privilege for any columns that are only read, such as those named in the WHERE clause. See GRANT.\n\nAs stated, a DELETE statement with no WHERE clause deletes all rows. A faster way to do this, when you do not need to know the number of deleted rows, is to use TRUNCATE TABLE. However, within a transaction or if you have a lock on the table,TRUNCATE TABLE cannot be used whereas DELETE can. See TRUNCATE TABLE, and LOCK.\n\nAS\n\nSingle-table DELETE statements support aliases. For example:\n\n``sql\nCREATE TABLE t1 (c1 INT);\nINSERT INTO t1 VALUES (1), (2);\n\nDELETE FROM t1 AS a1 WHERE a1.c1 = 2;\n`\n\nSingle-table DELETE statements do not support aliases.\n\nPARTITION\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n\nSee Application Time Periods - Deletion by Portion.\n\nRETURNING\n\nIt is possible to return a result set of the deleted rows for a single table to the client by using the syntax DELETE ... RETURNING select_expr [, select_expr2 ...]]\n\nAny of SQL expression that can be calculated from a single row fields is allowed. Subqueries are allowed. The AS keyword is allowed, so it is possible to use aliases.\n\nThe use of aggregate functions is not allowed. RETURNING cannot be used in multi-table DELETE statements.\n\nSame Source and Target Table\n\nIt is possible to delete from a table with the same source and target. For example:\n\n`sql\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n`\n\nDELETE HISTORY\n\nYou can use DELETE HISTORY` to delete historical information from System-versioned tables.\n\nExamples\n--------\n\nDELETE FROM page_hit ORDER BY TIMESTAMP LIMIT 1000000;\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/data-manipulation/changing-deleting-data/delete