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
 Select and update query

Author  Topic 

immad
Posting Yak Master

230 Posts

Posted - 2013-11-06 : 05:46:16
Hello

i want to select a data from a employee table and update that select data to attendlog1 table with match Eid

this is a employee data

EID----------bid
26478---------2


this is a attendlog data

EID-------------EBID
26478------------NULL


i want this type of result
EID-------------EBID
26478------------2

BID and EBID fields are change but values are same.

thanks





immad uddin ahmed

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-06 : 06:35:21
[code]
UPDATE a
SET EBID = bid
FROM employee e
INNER JOIN attendlog a
ON a.EID = e.EID
[/code]

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

immad
Posting Yak Master

230 Posts

Posted - 2013-11-06 : 07:24:37
quote:
Originally posted by visakh16


UPDATE a
SET EBID = bid
FROM employee e
INNER JOIN attendlog a
ON a.EID = e.EID


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs




Thanks :)

immad uddin ahmed
Go to Top of Page
   

- Advertisement -