当前位置:网站首页>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 表名
边栏推荐
猜你喜欢

How pycharm modifies multiline annotation shortcuts

Niuke network: Design LRU cache structure design LFU cache structure

tag动态规划-刷题预备知识-2. 0-1背包理论基础和二维数组解法模板

JVM entry door (1)

Discussion and generation of digital signature and analysis of its advantages

Row lock analysis and deadlock

Number of solutions for knapsack problem

MySQL exports all table indexes in the database

Padding percentage operation

DoS及攻击方法详解
随机推荐
A little experience of next (ITER (dataloader))
JVM入个门(1)
解决pycharm里面每个字母占一格空格的问题
JS cast
Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
清华&商汤&上海AI&CUHK提出Siamese Image Modeling,兼具linear probing和密集预测性能!
[dynamic planning] Jianzhi offer II 091 Paint the house
贝叶斯网络详解
Let torch cuda. is_ Experience of available() changing from false to true
transforms.RandomCrop()的输入只能是PIL image 不能是tensor
DoS及攻擊方法詳解
【QNX】命令
Get and set settings in 26class
Concept and working principle of data encryption standard (DES)
让torch.cuda.is_available()从false变成true的一点经验
Decision tree and random forest
DoS及攻击方法详解
KDD 2022 | how to use comparative learning in cross domain recommendation?
Row lock analysis and deadlock
小程序设置按钮分享功能