Home » SQL & PL/SQL » SQL & PL/SQL » Update statements from multiple tables
Update statements from multiple tables [message #20386] Mon, 20 May 2002 14:20 Go to next message
Jonathan
Messages: 10
Registered: May 2002
Junior Member
Can we include multiple tables in the from clause in an update statement?
Re: Update statements from multiple tables [message #20388 is a reply to message #20386] Mon, 20 May 2002 14:29 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
yes.
and make some joins in the where clause.
Re: Update statements from multiple tables [message #20390 is a reply to message #20386] Mon, 20 May 2002 14:42 Go to previous messageGo to next message
Jonathan
Messages: 10
Registered: May 2002
Junior Member
Thanks Mahesh, would it be possible if you gave a quick example
Re: Update statements from multiple tables [message #20392 is a reply to message #20390] Mon, 20 May 2002 15:00 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> get up
1 update emp
2 set ename='magvivek'
3 where emp.deptno in (select dept.deptno from dept)
4* and emp.empno=7369
5 /

1 row updated.

SQL> select * from emp;

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 magvivek CLERK 7902 17-DEC-02 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
Previous Topic: Re: SQL Count Statement
Next Topic: Re: SQL Count Statement
Goto Forum:
  


Current Time: Thu Apr 25 17:19:19 CDT 2024