例:
A    B    C
a    1    2
b    2    3
c    3    4
1d   5    6
1e   6    7
1f   8    9
怎么不上表变成(下):
A    B    C
1a   1    2
1b   2    3
1c   3    4
1d   5    6
1e   6    7
1f   8    9

解决方案 »

  1.   

    select A='1'+right(A,1) form yTable
      

  2.   

    create table T(A varchar(10), B int, C int)
    insert T select 'a' ,   1,    2
    union all select 'b' ,   2,    3
    union all select 'c' ,   3,    4
    union all select '1d',   5,    6
    union all select '1e',   6,    7
    union all select '1f',   8,    9update T set A='1'+A 
    where charindex('1', A)<>1select * from T--result
    A          B           C           
    ---------- ----------- ----------- 
    1a         1           2
    1b         2           3
    1c         3           4
    1d         5           6
    1e         6           7
    1f         8           9(6 row(s) affected)
      

  3.   

    update 上表
    set 上表.A='1'+ A 
    where substring(A,1,1)<>'1'