July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Like UPDATE, the DELETE command is simple. The general format of the DELETE command is
DELETE FROM table [ WHERE condition ]
The DELETE command removes all rows that satisfy the (optional) WHERE clause. Here is an example:
movies=# SELECT * FROM tapes; tape_id | title | duration ----------+----------------------+---------- AB-12345 | The Godfather | AB-67472 | The Godfather | MC-68873 | Casablanca | OW-41221 | Citizen Kane | AH-54706 | Rear Window | OW-42200 | Sly | 01:36 KJ-03335 | American Citizen, An | OW-42201 | Stone Cold | 01:52 (8 rows) movies=# BEGIN WORK; BEGIN movies=# DELETE FROM tapes WHERE duration IS NULL; DELETE 6 movies=# SELECT * FROM tapes; tape_id | title | duration ----------+------------+---------- OW-42200 | Sly ...
Read now
Unlock full access