select caset when charindex('-',Tel)>0 then Tel else '0510-'+right(Tel,len(TEL)-4) end from YourTable

解决方案 »

  1.   

    update table set telephone=replace(telephone,'0510','0510-') where left(telephone,4)='0510' and left(telephone,5)<>'0510-'
    感觉这个方法好!
      

  2.   

    update set 列=left(列,4)+'-'+right(列,7) where len(列)=11
      

  3.   

    怎么改名了?是小干部有心上人了吧!haha..
      

  4.   


    update t set Col=left(Col,4)+'-'+right(Col,len(Col)-4)
    where left(Col,4)='0510' and right(left(Col,5),1)<>'-'select * from t