In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Use the delete statement to delete the data from the table:
Syntax:
Delete from [where]
Delete means to delete.
Where is optional and can not be added, but if there are no conditions, the entire table can be deleted.
Example:
Delete from report form where name = 'Zhang San'
Meaning:
Delete Zhang San's information in the score sheet. If you don't add where, you will delete the entire score sheet.
Note:
Delete is used to delete an entire record, without deleting a single field, that is, without deleting an empty table, so column names do not appear after the delete.
~ delete from ~ ~
two。 Delete data from a table using the truncate table statement
Syntax:
Truncate table
Truncate table means to delete a table.
Example:
Truncate table score sheet
Meaning: delete all data in the score sheet (record rows)
Note: the truncate table function is similar to the delete statement without where sentence.
The difference between the two: the 1.truncate statement does not have the where sentence and can only delete the data of the entire table. On the other hand, delete can take where, which allows some data to be deleted conditionally. The 2.truncate statement does not record the transaction log, so the deleted data * cannot be recovered through the transaction log. And delete will record and recover. The 3.truncate statement deletes all rows in the table and the identifier column is reset to 0. Delete does not reset the identifier column. 4.truncate statements cannot be used for tables referenced by foreign key constraints.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.