Speaking SQL (part 1) - Termination With Extreme Prejudice
(Page 6 of 7 )
Just as you INSERT records into a table, you can also DELETE records with the DELETE command, which looks like this:
DELETE FROM <table_name>
For example, the command
mysql>
DELETE FROM members;
Query OK, 0 rows affected (0.06 sec)
would delete all the records from the "members"
table.
You can select a specific subset of rows to be deleted by adding the WHERE clause to the DELETE statement. The following example would only delete those records which had a member id of 16;
mysql>
DELETE FROM members WHERE member_id = 16;
Query OK, 1 row affected (0.06 sec)
Next: Old Data For New >>
More MySQL Articles
More By icarus, (c) Melonfire