时间:2021-07-01 10:21:17 帮助过:7人阅读
public void addTable (){
String add="";
for(int i=1;i<13;i++){
for(int j=0;j<60;j++){
add=add+"ALTER TABLE a_"+twoPoint(i)+"_"+twoPoint(j)+" ADD COLUMN mdiv int(10) not NULL COMMENT ‘xxx‘;\n"
+"ALTER TABLE a_"+twoPoint(i)+"_"+twoPoint(j)+" ADD COLUMN cdiv int(10) not NULL COMMENT ‘xxx‘;\n"
+"ALTER TABLE a_"+twoPoint(i)+"_"+twoPoint(j)+" ADD COLUMN check_status tinyint(4) NULL COMMENT ‘xxx‘;\n";
}
}
System.out.println(addColumn);
}
public String twoPoint(int i){
if(i<=9){
String a="0"+String.valueOf(i);
return a;
}
return String.valueOf(i);
}
建立分表sql执行语句批量生成工具(自创)
标签:语句 ddc system poi value stat return post point