将字段abc(123456)变成
a  b  c  d  e  f
1  2  3  4  5  6
有什么方法实现?用mysql/php语句拆分.

解决方案 »

  1.   

    在PHP中有个方法把字段得到,然后用str_slip()取abc,
    数据项就好办了吧!看楼下有什么好方法!
      

  2.   

    设数据表名为test:alter table test add column a char(1),b char(1),c char(1),d char(10),e char(1),f char(1);
    update test set a=mid(abc,1,1) b=mid(abc,2,1),c=mid(abc,3,1),d=mid(abc,4,1),e=mid(abc,5,1),f=mid(abc,6,1);
    ALTER TABLE test drop COLUMN abc;