Oracle deletes data and oracle deletes data.
The syntax for Oracle to delete data in a table is:
Syntax structure:
Delete from table name WHERE Condition
Code Demonstration:
SQL> delete from infos where stuid = 's100103 '; 1 row deleted SQL> COMMIT;
TRUNCATE
In database operations, the TRUNCATE command (a ddl command) can delete all data in the table at a time. The syntax is:
Syntax structure:
Truncate table name
Both TRUNCATE and DELETE can DELETE all the data in the table. The difference is:
1. TRUNCATE is a DDL command, and the deleted data cannot be recovered. The DELETE command is a DML command, and the deleted data can be recovered through the log file.
2. If there are many data records in a table, TRUNCATE is faster than DELETE.
The TRUNCATE command is dangerous, so the TRUNCATE command should be used with caution during actual development.