create table test
(
test_id varchar(50)
)insert into test(test_id) values('0222566')
select * from test 时显示的数据是 222566  那个0去那了呢,要想得到的是0222566,该怎么办

解决方案 »

  1.   

    你确认test_id是varchar(50)吗? 可能是插入的时候把它转成int了
      

  2.   

    不可能吧...?????create table test 

    test_id varchar(50) 
    ) insert into test(test_id) values('0222566') --
    --(1 行受影响)
    --test_id
    ----------------------------------------------------
    --0222566
    --
    --(1 行受影响)
    --select * from testdrop table test
      

  3.   

    --可能是int
    create table test 

    test_id int
    ) insert into test(test_id) values('0222566') --(1 行受影响)
    --test_id
    -------------
    --222566
    --
    --(1 行受影响)
    --select * from testdrop table test
      

  4.   

    哦,OK了,原来我update user_info set user_class=0600 where user_id='123' 
    改成这样对了    update user_info set user_class='0600' where user_id='123'
    少了这个''