程序员求职经验分享与学习资料整理平台

网站首页 > 文章精选 正文

ORACLE语法——删除(删除oracle字段)

balukai 2025-03-30 14:22:43 文章精选 6 ℃

1、删除重复行

select distinct sex from table

2、删除字段

alter table dept drop column deptno

3、删除一个表

drop table student

4、删除一条记录

delete from student where name is NULL

5、删除表中所有记录

delete from student (delete删除的记录可以使用rollback恢复)

6、永久性删除表中所有记录

TRUNCATE table test (删除记录无法使用rollback命令恢复)

7、删除索引

drop index myindex

8、删除用户

drop user user1

9、删除用户及对应对象

drop user user1 cascade

10、清屏

host clear

注意:oracle中运行linux命令在前面加host

最近发表
标签列表