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 query condition

Author  Topic 

mohdmartin
Starting Member

22 Posts

Posted - 2007-07-07 : 07:38:33
How can update / insert records from table1 colum to table2 colum
with condition ?

I want to insert/update records like this.

update employee
set joine_date = select joine_date from master_table
where emp_id.employee=emp_id.master_table


regards
Martin

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-07 : 07:50:36
[code]UPDATE e
SET joine_date = m.joine_date
FROM employee e INNER JOIN master_table m
ON e.emp_id = m.emp_id
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

mohdmartin
Starting Member

22 Posts

Posted - 2007-07-08 : 04:35:45
Thanks
Go to Top of Page
   

- Advertisement -