numberid='0'+numberid
好像这种用法,只能是数字吧

解决方案 »

  1.   

    字符串相加要用CONCAT函数
    update matriculater set numberid=CONCAT('0'+numberid) where length(numberid)='8'
      

  2.   

    update matriculater set numberid=CONCAT('0',numberid) where length(numberid)='8'要逗号,不要加号
      

  3.   

    这是CONCAT的用法:CONCAT(str1,str2,...) 
    Returns the string that results from concatenating the arguments. Returns NULL if any argument is NULL. May have more than 2 arguments. A numeric argument is converted to the equivalent string form: mysql> SELECT CONCAT('My', 'S', 'QL');
            -> 'MySQL'
    mysql> SELECT CONCAT('My', NULL, 'QL');
            -> NULL
    mysql> SELECT CONCAT(14.3);
            -> '14.3'