Delete & Truncate examples

Delete & Truncate examples.

Last updated:

Warning: Review and test in a non-production environment before running.

Back to results

Delete records from table only when column "column_name" = ‘value’
DELETE FROM table_name WHERE column_name = ‘value’;

Delete record with id = '23998'
DELETE FROM customers WHERE id = '23998';

TRUNCATE

Truncate will delete every record in table, but the table will exists without any record.
TRUNCATE TABLE customers_2;