当前位置:网站首页>MySQL - clear data in the table
MySQL - clear data in the table
2022-06-29 18:14:00 【Full stack programmer webmaster】
mysql – Empty table data
There are two ways to delete table information :
truncate table table_name;
delete * from table_name; notes : truncate In operation table It can be omitted ,delete In operation * It can be omitted
- truncate、delete The difference between clearing table data :
1> truncate Delete as a whole ( Faster ),delete Delete... Item by item ( Slower ) 2> truncate Do not write to the server log,delete Write server log, That is to say truncate Efficient than delete The reason for high 3> truncate Do not activate trigger ( trigger ), But it will reset Identity ( Identity column 、 Self increasing field ), It is equivalent to that the auto increment column will be set to the initial value , Again from 1 Start recording , Instead of following the original ID Count . and delete After deletion ,identity It is still the latest record that was deleted ID Add 1 Record after . If you only need to delete some records in the table , Only use DELETE Sentence match where Conditions
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/101829.html Link to the original text :https://javaforall.cn
边栏推荐
- mysql — 清空表中数据
- VB. Net read / write NFC ntag tag source code
- [tcapulusdb knowledge base] tcapulusdb system user group introduction
- Web Scraping with Beautiful Soup for Data Scientist
- Codeworks 5 questions per day (1700 for each) - the next day
- Request header field xxxx is not allowed by Access-Control-Allow-Headers in preflight response问题
- Detailed analysis on the use of MySQL stored procedure loop
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
- [wangdingbei 2020 Qinglong formation]areuserialz
- 金鱼哥RHCA回忆录:DO447构建高级作业工作流--创建作业模板调查以设置工作的变量
猜你喜欢

Bloom filter:

YoloV6+TensorRT+ONNX:基于WIN10+TensorRT8+YoloV6+ONNX的部署

JDBC Codes connexes

Adobe Premiere基础-批量素材导入序列-变速和倒放(回忆)-连续动作镜头切换-字幕要求(十三)

My first experience of remote office | community essay solicitation

Adobe Premiere Foundation - réglage du son (correction du volume, réduction du bruit, tonalité téléphonique, changement de hauteur, égaliseur de paramètres) (XVIII)

Niuke small Bai monthly race 52 D ring insectivorous (feet +st table)

How to use idea?

C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad

Let Google search your blog
随机推荐
Record that the server has been invaded by viruses: the SSH password has been changed, the login fails, the malicious program runs full of CPU, the jar package fails to start automatically, and you ha
工作流模块Jar包启动报错:liquibase – Waiting for changelog lock….
Maxcompute string replacement function -replace
VB.Net读写NFC Ntag标签源码
JDBC Codes connexes
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
Visio annotation, annotation location
Relationship among controller, service and Dao
Matlab farthest point sampling (FPS)
Have you grasped the most frequently asked question in the interview about massive data processing?
Adobe Premiere基础-素材嵌套(制作抖音结尾头像动画)(九)
行程卡“摘星”热搜第一!刺激旅游产品搜索量齐上涨
MATLAB 最远点采样(FPS)
3h精通OpenCV(六)-图像堆叠
Prevent form resubmission based on annotations and interceptors
codeforces每日5题(均1700)-第二天
VMware installation esxi
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
lodash深拷贝使用