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
 update using join conditions

Author  Topic 

yaman
Posting Yak Master

213 Posts

Posted - 2008-04-07 : 05:56:10
I have three table For example
Employee (Empid , Empname , Esal)
Department (Deptid , Deptname , empid )
Staff (staffid , Staffname , Empid)

It is just example
how can i update Empname whose staffid =1 accor to staffid)
using Join Conditions :- Pls help me out ..
or
how to update data using JOIN Conditions







Yaman

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-07 : 06:00:52
[code]Update E
set Esal = Esal + 1000
From Employee E JOIN Staff S on E.Empid = S.Empid
where S.StaffID = 1[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

yaman
Posting Yak Master

213 Posts

Posted - 2008-04-07 : 06:22:34
Thank You Very Much Sir





Yaman
Go to Top of Page
   

- Advertisement -