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.
Author |
Topic |
mateenmohd
Constraint Violating Yak Guru
297 Posts |
Posted - 2004-08-24 : 03:21:47
|
update (insert) data from one table to another table.employees table------------------empno joindate123412351236.......info table------------------empno joindate1234 3/11/20031235 6/10/20021236 9/12/2000.....how can update (insert) the employees table column joindate with the info table column joindate ?I want to insert (update) info table joindate into employees table.insert all joindate into employees joindate where employees.empno=info.empnoupdate employeesset joindate = from info where employees.empno=info.empnoand joindate is nullregards.Mateen |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-08-24 : 04:28:26
|
this should do the update:update eset e.joinDate = i.joinDatefrom employees e inner join info i on (e.empno = i.empno)Go with the flow & have fun! Else fight the flow :) |
|
|
mateenmohd
Constraint Violating Yak Guru
297 Posts |
Posted - 2004-08-25 : 06:24:10
|
thanks for response.it doble the records.I have four hundred records, after run this queryit show eight hundred records why ?Mateen |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-08-25 : 06:38:40
|
well, with out more info there's not really much to say.post the create table, insert into (sample data), and desired results so we can test it on our machines and give the answer.Go with the flow & have fun! Else fight the flow :) |
|
|
|
|
|