How do you clear data from a table in Oracle?
The following SQL statement can be used in Oracle to truncate table data:
DELETE FROM 表名;
To empty a table while keeping its structure intact, you can use the TRUNCATE statement.
TRUNCATE TABLE 表名;
Please be aware that the TRUNCATE statement will delete all data in the table, without logging it in the transaction log and unable to be rolled back. Therefore, make sure to back up the data you want to keep before executing the TRUNCATE statement.
Additionally, you can utilize the following statement to delete all rows in the table:
DELETE FROM 表名 WHERE 1=1;
This statement will delete all rows in the table, as the WHERE condition 1=1 is always true.