用最古老的mysql工具 (其实不知道是不是,只是我最先用的就是这个) phpMyadmin是可以导出SQL语句的。 格式如: insert into table_name(col1,col2) value(val1,val2) 可以满足到你的要求。
如果没条件的话就用 insert into newtable(col1,col2,.....) select col1,col2,..... from oldtable 有条件的话就用 insert into newtable(col1,col2,.....) select col1,col2,..... from oldtable where .......说明:旧表中没的字段col5新表为空有两中方法 1、newtable(col1,col2,.....) select col1,col2,..... from oldtable在newtable() 不列出 2、newtable(col1,col2,..,col5,...) select col1,col2,..,'' as col5,... from oldtable
(其实不知道是不是,只是我最先用的就是这个)
phpMyadmin是可以导出SQL语句的。
格式如: insert into table_name(col1,col2) value(val1,val2)
可以满足到你的要求。
insert into newtable(col1,col2,.....) select col1,col2,..... from oldtable
有条件的话就用
insert into newtable(col1,col2,.....) select col1,col2,..... from oldtable
where .......说明:旧表中没的字段col5新表为空有两中方法
1、newtable(col1,col2,.....) select col1,col2,..... from oldtable在newtable() 不列出
2、newtable(col1,col2,..,col5,...) select col1,col2,..,'' as col5,... from oldtable