Oracle deletes data and oracle deletes data.

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.