读书人

超简单,请教如何在一个表中同时update

发布时间: 2012-02-02 23:57:14 作者: rapoo

超简单,请问怎么在一个表中同时update更新两个数据!
表; test
字段: a 字段: b 字段:c
当 a值为1 时候 更新b= '1 ' 更新c= '1 '

update test set b= '1 ' where a=1
update test set c= '1 ' where a=1

分着写我会,怎么把b和c的更新用一个update语句来实现呢?谢谢大家,我是菜鸟,不要笑话,请不吝赐教!


[解决办法]
update test set b= '1 ',c= '1 '
where a=1

读书人网 >SQL Server

热点推荐