MySQL Phrasebook

DELETE FROM book WHERE cond = 'poor';

Assume that you have decided that it is time to permanently retire any books in your library that are in poor condition. The simple DELETE query in the phrasebox accomplishes exactly that.

The basic syntax for DELETE is

DELETE FROM table_name WHERE some_conditions;

The WHERE clause used in the DELETE command is the same familiar WHERE clause used in SELECT and UPDATE commands. For more information, see Chapter 4.

Категории