How to delete data in an Oracle table

a grammar

DELETE FROM table_name
[WHERE conditions]
Two examples
1. Unconditional deletion
  1. SQL> create table testdel
  2. 2as
  3. 3select*from userinfo;
  4. 表已创建。
  5. SQL>deletefrom testdel;
  6. 已删除4行。
  7. SQL>select*from testdel;
  8. 未选定行
2. Conditional deletion
  1. SQL>delete userinfo where username='yyy';
  2. 已删除1行。
  3. SQL>select username from userinfo;
  4. USERNAME
  5. --------------------
  6. xxx

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326166842&siteId=291194637