从一个表中删去行-SQL语言基础

时间:2021-04-25 19:38:26
【文件属性】:
文件名称:从一个表中删去行-SQL语言基础
文件大小:5.26MB
文件格式:PPT
更新时间:2021-04-25 19:38:26
SQL 基础 从一个表中删去行 * SQL> DELETE FROM department 2 WHERE dname = 'DEVELOPMENT'; 1 row deleted. SQL> DELETE FROM department; 4 rows deleted. 使用 WHERE 子句以指定哪些行应当被删去. 如果忽略WHERE 子句,那么表中所有的数据. * Deleting Rows (continued) You can delete specific rows by specifying the WHERE clause in the DELETE statement. The slide example deletes the DEVELOPMENT department from the DEPARTMENT table. You can confirm the delete operation by displaying the deleted rows using the SELECT statement. Example Remove all employees who started after January 1, 1997. If you omit the WHERE clause, all rows in the table are deleted. The second example on the slide deletes all the rows from the DEPARTMENT table because no WHERE clause has been specified. Note: The DEPARTMENT table has the same data as the DEPT table. SQL> SELECT * 2 FROM department 3 WHERE dname = 'DEVELOPMENT'; no rows selected. SQL> DELETE FROM emp 2 WHERE hiredate > TO_DATE('01.01.1997', 'DD.MM.YYYY'); 1 row deleted.

网友评论