SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select and update query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

immad
Posting Yak Master

Pakistan
218 Posts

Posted - 11/06/2013 :  05:46:16  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 11/06/2013 :  06:35:21  Show Profile  Reply with Quote

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
Go to Top of Page

immad
Posting Yak Master

Pakistan
218 Posts

Posted - 11/06/2013 :  07:24:37  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000