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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Update the column fields by condition

Author  Topic 

usafelix
Posting Yak Master

165 Posts

Posted - 2014-06-25 : 23:33:51
I have one table and have three column fields. The staff record have 1000 employee, how I can change the employee from officer position to new position replace in this current position column.

Staff name | current position | new position.
Peter officer manager
david officer manager

staff name | current position | new position
peter manager manager
david manager manager

please correct my query statement :
select staff_name from employee where current_position like 'officer'
then new_position 'manager'

stepson
Aged Yak Warrior

545 Posts

Posted - 2014-06-26 : 01:22:59
You need an update , to update the current position ?
If yes , check this:

UPDATE employee
SET [current position]='manager'
WHERE current_position = 'officer'




sabinWeb MCP
Go to Top of Page
   

- Advertisement -