SQL语句的UPDATE运动

来源:百度知道 编辑:UC知道 时间:2024/06/22 05:33:02
我这边有张表,里面有个“电话”字段,我现在要把所有的号码前面加上021我要如何使用UPDATE语句?

如果 电话 是char
update 表 set 电话 = '021'+ 电话

如果 电话 是number
update 表 set 电话 = to_number('021'+ to_char(电话))

updata table set tel="021"+tel

update 表 set 电话 = '021'+ 电话

如果 电话 是字符型
可以这样
update 表 set 电话 = '021'+ 电话

update 【表名】 set 【电话】='021'+【电话】
试试看