当前位置:网站首页>sql中的几种删除操作
sql中的几种删除操作
2022-06-26 18:07:00 【yanruo06280】
sql中的几种删除操作用法与区别
1、delete语句
Delete删除表数据,保留表结构,且可以加where,删除一行或多行。
执行删除的过程是每次从表中删除一行,并且同时将该行的删除操作作为事务记录在日志中保存以便进行进行回滚操作
delete from 表名 where codition
2、Truncate删除表数据,保留表结构,不可以加where,
一次性地从表中删除所有的数据并不把单独的删除操作记录记入日志保存,删除行是不能恢复的。并且在删除的过程中不会激活与表有关的删除触发器。执行速度快。TRUNCATE 只能对TABLE;DELETE可以是table和view
truncate table 表名
清除速度方面,truncate比delete更快
3、Drop是完全删除,包括表结构
drop table 表名
边栏推荐
- Digital signature standard (DSS)
- Using redis for user access data statistics hyperloglog and bitmap advanced data types
- Discussion and generation of digital signature and analysis of its advantages
- 数据加密标准DES安全性
- Map and list < map > transfer to corresponding objects
- Detailed explanation of dos and attack methods
- Paging query and join Association query optimization
- (必须掌握的多线程知识点)认识线程,创建线程,使用Thread的常见方法及属性,以及线程的状态和状态转移的意义
- Niuke network: Design LRU cache structure design LFU cache structure
- Let torch cuda. is_ Experience of available() changing from false to true
猜你喜欢
随机推荐
[QNX] Command
vutils. make_ A little experience of grid () in relation to black and white images
How sparksql returns a specific day of the week by date -dayofweek function
Bayesian network explanation
in和exsits、count(*)查询优化
Decision tree and random forest
Connected to surface test questions
Several key points in divorce agreement
深层次安全定义剖析及加密技术
背包问题求方案数
map和filter方法对于稀缺数组的处理
IDEA收藏代码、快速打开favorites收藏窗口
Static registration and dynamic registration of JNI
[buuctf.reverse] 126-130
Padding percentage operation
Number of solutions for knapsack problem
Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
刻录光盘的程序步骤
【Unity】在Unity中使用C#执行外部文件,如.exe或者.bat
RSA encryption and decryption details








