DELETE Statement

Deletes rows from a table.

Category: Data Manipulation
Supports: EXECUTE Statement
Data source: SAS data set, SPD Engine data set, Aster, DB2 under UNIX and PC, Greenplum, MDS, MySQL, Netezza, ODBC, Oracle, PostgreSQL, SAP HANA, Sybase IQ, Teradata

Syntax

Arguments

table

specifies the table from which you are deleting rows.

Restriction If row-level permissions are in effect for the table, you cannot delete rows from the table. Row-level security is available only with SAS Federation Server. See the SAS Federation Server documentation for more information.
Tip You can use '.*' after the table name for compatibility with Microsoft Access tables.

WHERE <search-condition>

specifies any valid WHERE clause used to limit the number of rows that are deleted.

Tip You can use parameter arrays in the WHERE statement.
See WHERE clause in the SELECT Statement

Details

The DELETE statement deletes the rows that satisfy the WHERE clause from the specified table. If you do not use a WHERE clause, all rows are deleted.

Comparisons

The DROP TABLE statement removes the table from the database completely, including the table structure. The DELETE statement deletes only the rows (data) in a table.