[Postgres] Removing Data with SQL Delete, Truncate, and Drop
SQL and with Data delete drop Postgres truncate
2023-09-14 08:59:13 时间
Delete:
delete from Users where last_name = 'clark';
If you wanted to delete everything in our table, I mentioned you could just use the delete
command without a condition.
However, using truncate
is a more performant way to do so.
truncate Users;
Unlike the delete
command, it doesn't scan over the entire table. We also have the ability to truncate
more than one table with just one statement by listing the other tables with commas.
Finally, if we're trying to remove the table completely from our database, we use the drop
command.
drop table Users;
Once we run this command, all of the data is deleted and we cannot query anything from this table.
相关文章
- SQL审核 | SQLE OceanBase for MySQL 新增了部分审核规则
- C#移动端开发:获取用户定位和IP地址上传至SQL数据库
- sql服务器系统时间格式,SQL Server 日期格式和日期操做
- 客快物流大数据项目(七十二):Impala sql 语法
- Oracle 通过sql to_date()和 to_char() 转化日期格式
- 【愚公系列】2023年03月 Java教学课程 112-JDBC的(SQL注入和事务)
- SQL查询方法精华集
- 实用技巧:精通Oracle常用SQL(oracle常用sql)
- Oracle表索引分析:优化SQL查询性能(oracle表索引分析)
- Oracle SQL优化:提升性能与速度(oraclesql优化)
- SQL Server中最常用的函数(sqlserver常用函数)
- Exploring the Power of MySQL Stored Procedures with SQL(mysql存储过程sql)
- MySQL 的 SQL 线程优化策略(mysqlsql线程)
- 从SQL格式数据快速导入MSSQL数据库(sql格式导入mssql)
- SQL与MSSQL:各有自身特性的不同之处(sql与mssql的区别)
- SQL Server中定义的标准:指引完美设计(sqlserver定义)
- SQL Server地图开发:实现地理信息化管理(sqlserver 地图)
- Oracle多条SQL的执行方法及优化建议(oracle多条sql)
- 数据管理用SQL Server实现上月数据管理(sqlserver 上月)
- Oracle终结SQL:解救数据库之路(oracle终止sql)
- 利用Oracle SQL工具实现数据库管理(oracle sql工具)
- SQL与MySQL的异同——引起关注的相似之处(sql和mysql的区别)
- MySQL SQL语句的写法详解(mysql中sql怎么写)
- MySQL SQL语句编写指南(mysql中写sql语句)
- Redis缓存的SQL优化技术(sql缓存redis机制)
- MySQL 上下级 SQL 查询技巧(mysql 上下级sql)
- 从Oracle中探索SQL函数的应用(oracle中sql函数)
- C#拼接SQL语句用ROW_NUMBER实现的高效分页排序
- SQL查询连续号码段的巧妙解法