批量更新字段
某一表中有2个字段,A和B,如果A中字段是1,BZ中字段里的所有数据后面加上‘--新品’,请问大家怎么办?
[解决办法]
- SQL code
update table1 set b=b|| '--新品' where a=1;commit;
[解决办法]
update tab_name
set B=B||'--新品'
where A=1
[解决办法]
- SQL code
update table1 set b=b||'--新品' where a=1;commit;
发布时间: 2012-01-23 21:57:28 作者: rapoo
批量更新字段
某一表中有2个字段,A和B,如果A中字段是1,BZ中字段里的所有数据后面加上‘--新品’,请问大家怎么办?
[解决办法]
update table1 set b=b|| '--新品' where a=1;commit;
[解决办法]
update tab_name
set B=B||'--新品'
where A=1
[解决办法]
update table1 set b=b||'--新品' where a=1;commit;