当前位置:网站首页>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
边栏推荐
- 3H proficient in opencv (VI) - image stacking
- Have you grasped the most frequently asked question in the interview about massive data processing?
- Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa
- The soft youth under the blessing of devcloud makes education "smart" in the cloud
- Adobe Premiere基础-素材嵌套(制作抖音结尾头像动画)(九)
- 小白月赛51 补题 E G F
- How do I add SmartArt to slides in PowerPoint?
- [target tracking] |stark configuration win OTB
- JS merge two one-dimensional arrays and remove the same items (collation)
- Longest XOR path (dfs+01trie)
猜你喜欢

Abc253 D fizzbuzz sum hard (tolerance exclusion theorem)

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)

Adobe Premiere基础-常用的视频特效(边角定位,马赛克,模糊,锐化,手写工具,效果控件层级顺序)(十六)

ISO 32000-2 international standard 7.7

VB.Net读写NFC Ntag标签源码
![[target tracking] |stark configuration win OTB](/img/29/a6b3b99b7d2349499aede9e76ab29a.png)
[target tracking] |stark configuration win OTB

阿里云不同账号新旧服务器镜像迁移数据迁移同步

QQ如何开通在线客服

jdbc_相关代码

软件测试——基础理论知识你都不一定看得懂
随机推荐
3H proficient in opencv (VII) - color detection
Parental delegation mechanism
Xiaomai technology x hologres: high availability of real-time data warehouse construction of ten billion level advertising
C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
阿里云不同账号新旧服务器镜像迁移数据迁移同步
Analyze the implementation principle of zero copy mechanism, applicable scenarios and code implementation
Find the maximum XOR value in the sequence given a number (01 Dictionary)
金鱼哥RHCA回忆录:DO447构建高级作业工作流--创建作业模板调查以设置工作的变量
QQ如何开通在线客服
Web Scraping with Beautiful Soup for Data Scientist
3h精通OpenCV(八)-形状检测
EasyCVR部署服务器集群时,出现一台在线一台不在线是什么原因?
Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
Niuke small Bai monthly race 52 D ring insectivorous (feet +st table)
程序员资源推荐指南
[wangdingbei 2020 Qinglong formation]areuserialz
ISO 32000-2 international standard 7.7
You can do sideline work