日期:2014-05-18  浏览次数:20381 次

update的问题。
数据库中的电话号码为7位的,如:1234567,现在要求将所有字段长度小于8的号码前面加“8”,修改后为:81234567。
请问应该怎么写这个语句啊?
谢谢大家!

------解决方案--------------------
--这样好点
update A
set phone= '8 '+phone
where len(phone) <8
From @t A
------解决方案--------------------
update @t
set phone= '8 '+phone
where len(phone) <8

................