How can I delete record that it's ID=8 ????
Printable View
How can I delete record that it's ID=8 ????
DELETE * FROM tableName WHERE ID = 8;
you don't need to put the * in according to the docs, that is just for compatibilty with Access apparently :)
wow, I didn't know that. So
DELETE FROM tbl WHERE ID = '$x'
will work fine by itself. Is that so with multi-table deletes?
DELETE tblOne.*, tblTwo.* WHERE tblOne.ID = tblTwo.one_ID
yep
Quote:
The idea is that only matching rows from the tables listed before the FROM or before the USING clause are deleted. The effect is that you can delete rows from many tables at the same time and also have additional tables that are used for searching.
The .* after the table names is there just to be compatible with Access:
DELETE t1,t2 FROM t1,t2,t3 WHERE t1.id=t2.id AND t2.id=t3.id
or
DELETE FROM t1,t2 USING t1,t2,t3 WHERE t1.id=t2.id AND t2.id=t3.id