oracle----删除数据

时间:2022-02-03 04:30:33

1. 删除数据:delete语句:

语法:

DELETE FROM table_name;

(1),无条件删除:

SQL> create table testdel
2 as select * from userinfo; 表已创建。 SQL> delete from testdel; 已删除4行。 SQL> select * from testdel; 未选定行 SQL>

(2),有条件的删除:

SQL> select username from userinfo;

USERNAME
--------------------
xxx
yyy SQL> delete from userinfo where username='yyy'; 已删除 1 行。 SQL> select username from userinfo; USERNAME
--------------------
xxx SQL>