Using a language command, delete removes a row from a table.
delete [from] [[database.]owner.]{table_name|view_name} [where search_conditions]
delete [[database.]owner.]{table_name | view_name} [from [[database.]owner.]{table_name | view_name} [, [[database.]owner.]{table_name | view_name}]...] [where search_conditions]
is an optional keyword used for compatibility with other versions of SQL. Follow it with the name of the table or view from which you want to remove rows.
allows you to name more than one table or view to use with a where clause when specifying the rows to delete. The from clause allows you to delete rows from one table based on data stored in other tables, giving you much of the power of an embedded select statement.
is a standard where clause.
is a valid where clause component. It sets the conditions for the rows that are retrieved. A search condition can include column names, constants, joins, the keywords is null, is not null, or, like, and, or any combination.
delete from authors where au_lname = “McBadden”
You cannot use delete with a multi-table view.
If you do not use a where clause, all rows are deleted from the table or view that is named after the delete [from] T-SQL keyword parameter.
Copyright © 2005. Sybase Inc. All rights reserved. |