Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Updating a table with inner join included

Author  Topic 

marcusstar10
Starting Member

14 Posts

Posted - 2011-03-16 : 08:54:58
im trying to update a column in the employee table with the value "YES". Im getting an error message saying im missing a SET statement from this code below:

update employee e
inner join rentals r
on e.employee_id=r.employee_id
inner join job j
on e.job_id=j.job_id
SET e.review='YES'
where r.plate ='FY06WNT'
and j.function !='MANAGER'
and j.function !='PRESIDENT';

Any help is greatly appreciated!

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-03-16 : 08:56:09

update e
SET e.review='YES'
from employee
inner join rentals r
on e.employee_id=r.employee_id
inner join job j
on e.job_id=j.job_id
where r.plate ='FY06WNT'
and j.function !='MANAGER'
and j.function !='PRESIDENT';

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-03-16 : 09:06:27
Madhi,

He's programming in Oracle, but gets his kicks wasting our time trying to help him.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-03-16 : 09:40:21
quote:
Originally posted by jimf

Madhi,

He's programming in Oracle, but gets his kicks wasting our time trying to help him.

Jim

Everyday I learn something that somebody else already knew


Ok. Thanks

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-03-16 : 10:05:47
quote:
Originally posted by marcusstar10

im trying to update a column in the employee table with the value "YES". Im getting an error message saying im missing a SET statement from this code below:

update employee e
inner join rentals r
on e.employee_id=r.employee_id
inner join job j
on e.job_id=j.job_id
SET e.review='YES'
where r.plate ='FY06WNT'
and j.function !='MANAGER'
and j.function !='PRESIDENT';

Any help is greatly appreciated!


This site is for MS SQL Server. For ORACLE questions post at www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -