对基于另一个表的行进行更改-SQL语言基础

时间:2021-04-25 19:38:26
【文件属性】:
文件名称:对基于另一个表的行进行更改-SQL语言基础
文件大小:5.26MB
文件格式:PPT
更新时间:2021-04-25 19:38:26
SQL 基础 对基于另一个表的行进行更改 * SQL> UPDATE employee 2 SET deptno = (SELECT deptno 3 FROM emp 4 WHERE empno = 7788) 5 WHERE job = (SELECT job 6 FROM emp 7 WHERE empno = 7788); 2 rows updated. 在 UPDATE语句中,使用子查询来进行更改,更改的数据与其它表中的数据有关. * Updating Rows Based on Another Table You can use subqueries in UPDATE statements to update rows in a table. The example on the slide updates the EMPLOYEE table based on the values from the EMP table. It changes the department number of all employees with employee 7788’s job title to employee 7788’s current department number.

网友评论