$Header: /cvsroot/pgsql/doc/src/sgml/ref/delete.sgml,v 1.19 2003/09/12 00:12:47 tgl Exp $ PostgreSQL documentation --> DELETE SQL - Language Statements DELETE delete rows of a table DELETE DELETE FROM [ ONLY ] table [ WHERE condition ] Description DELETE deletes rows that satisfy the WHERE clause from the specified table. If the WHERE clause is absent, the effect is to delete all rows in the table. The result is a valid, but empty table. is a PostgreSQL extension which provides a faster mechanism to remove all rows from a table. By default, DELETE will delete rows in the specified table and all its subtables. If you wish to only delete from the specific table mentioned, you must use the ONLY clause. You must have the DELETE privilege on the table to delete from it, as well as the SELECT privilege for any table whose values are read in the class="parameter">condition. Parameters table The name (optionally schema-qualified) of an existing table. condition A value expression that returns a value of type boolean that determines the rows which are to be deleted. Outputs On successful completion, a DELETE command returns a command tag of the form DELETE count The count is the number of rows deleted. If count is 0, no rows matched the class="parameter">condition (this is not considered an error). Examples Delete all films but musicals: DELETE FROM films WHERE kind <> 'Musical'; Clear the table films: DELETE FROM films; Compatibility This command conforms to the SQL standard. Local variables: mode: sgml sgml-omittag:nil sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../reference.ced" sgml-exposed-tags:nil sgml-local-catalogs:"/usr/lib/sgml/catalog" sgml-local-ecat-files:nil End: -->