SQL Server查询命令

时间:2010-05-05 08:27:01

标签: sql sql-server sql-update

我有一个SQL数据库表,我想在表格中找到“房间”显示为“已显示”的所有内容,在“状态”字段中插入“已禁用”,然后删除“房间”中的条目。

基本上将条目从一个字段移动到另一个字段(如果'Room'字段中有'DISPOSED')

希望这是有道理的。

感谢您的帮助。

2 个答案:

答案 0 :(得分:2)

Update table_name SET room='', Stauts='DISPOSED' where Room='DISPOSED'

OR

Update table_name SET room=null, Stauts='DISPOSED' where Room='DISPOSED'

答案 1 :(得分:0)

SQL是

更新表 SET status = room,room = null 房间='已弃置'