登录 注册
当前位置:主页 > 资源下载 > 使用SQL语言基础知识,根据另一个表来删除行

使用SQL语言基础知识,根据另一个表来删除行

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

资源介绍

参照另一个表来删除行 * SQL> DELETE FROM employee 2 WHERE deptno = 3 (SELECT deptno 4 FROM dept 5 WHERE dname ='SALES'); 6 rows deleted. 使用子查询,使得 DELETE 语句能从另一个表中删除某些行. * Deleting Rows Based on Another Table You can use subqueries to delete rows from a table based on values from another table. The example on the slide deletes all the employees who are in department 30. The subquery searches the DEPT table to find the department number for the SALES department. The subquery then feeds the department number to the main query, which deletes rows of data from the EMPLOYEE table based on this department number.