登录 注册
当前位置:主页 > 资源下载 > 在SQL语言基础中,如何从一个表中删除行

在SQL语言基础中,如何从一个表中删除行

  • 更新:2024-07-07 11:41:50
  • 大小:5.26MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Informix - 数据库
  • 格式:PPT

资源介绍

从一个表中删去行 * 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.