In SQL, rows are deleted through the DELETE statement. The syntax is DELETE FROM table_name WHERE condition. In the parameters, table_name refers to the target table, and condition is an optional condition, specifying the rows to be deleted. If omitted, all rows will be deleted. For example: delete the row named "John" DELETE FROM customers WHERE name = 'John'; delete the amount greater than $100 row DELETE FROM orders WHERE amount > 100.
Statements to delete rows in SQL
How to delete rows
## The #DELETE statement is used to delete rows from a table.Syntax
<code class="sql">DELETE FROM table_name WHERE condition;</code>
Parameters
Example
Delete all rows with the name "John" in thecustomers table:
<code class="sql">DELETE FROM customers WHERE name = 'John';</code>
orders All rows in the table with amounts greater than $100:
<code class="sql">DELETE FROM orders WHERE amount > 100;</code>
Note
The above is the detailed content of Statement to delete rows in sql. For more information, please follow other related articles on the PHP Chinese website!