参照另一个表来删除行-SQL语言基础

时间:2024-05-15 13:25:07
【文件属性】:

文件名称:参照另一个表来删除行-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:25:07

SQL 基础

参照另一个表来删除行 * 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.


网友评论