alter table
add column 时怎么才能把该列加到第3列谢谢了

解决方案 »

  1.   

    做不到.以下是sql server的做法.select c1,c2,0 c3,c4,c5... into tmp from tb
    drop table tbselect * into tb from tmp
    drop table tmp就是说使用语句先生成一表,包含需要的列和加的列,删除原表,再从新表创建原表.
      

  2.   

    有楼上的思路 oracle的语句是
    create table temp as 
    select a,b,' ' as d,c from A1;
    drop table A1;
    create table A1 as
    select * from temp;
    drop table temp;
      

  3.   

    然后在用alter table A1 modify来确定字段的类型
      

  4.   

    如果是sql server,默认值就是数据的类型,不需要改.
    如0代表字符型,''代表varchar2.....