在mysql中,先创建了一表student,并插入了数据,后又加入了一列,但不知道如何在该列中插入数据,高手指教,表如下:
+----+---------+---------+------+
| id | name    | address | tel  |
+----+---------+---------+------+
|  2 | luwb    | wuhu    | NULL |
|  3 | xuhb    | wuhu    | NULL |
|  4 | gangpao | hunan   | NULL |
+----+---------+---------+------+,就是怎样在tel列插入数据?

解决方案 »

  1.   

    alter table add column tel varchar(8) default "00000000";
      

  2.   

    update tt set tel=123 where ....
      

  3.   

    update student set tel = *** where id =2 ;
    update student set tel = *** where id =3 ;
    update student set tel = *** where id =4 ;......
      

  4.   

    4楼的方法试过了,不行的,错误: Out of range value adjusted for column 'tel' at row 1;
      

  5.   

    #确定下你新添加字段tel的数据类型是否是varchar,还有长度,再执行下面语句
    update student set tel = '010-12345678' where name='luwb';
    ...........
      

  6.   


    你tel多好位?
    int 的范围是 -2147483648 到 2147483647如果超了你可以用
    int unsigned  他的范围是  0 到 4294967295 
    如果还不过那就用float