DB2 SQL 103 DML : DELETE and TRUNCATE
SQL DELETE is quite straightforward.
DELETE FROM TABLENAME WHERE COLUMN1='X' and COLUMN2='Y'
There is one more SQL statement to delete records from a table and that is SQL TRUNCATE TABLE statement.
TRUNCATE TABLE table-name
Difference between DELETE and TRUNCATE:
- TRUNCATE statement has no WHERE clause. So it will delete all the records of table.
- By default ,TRUNCATE statement does not call any DELETE TRIGGERS(IGNORE DELETE TRIGGERS).