insert into tablename(feild1,feild2,...) select feild1,seild2,... from anothertable where ...
这是在数据库课程中学过的,没想到都已经忘了。
select * into anothertable from table where...
如果涉及到从Excel中存取数据,方法是:
insert into PlotInfo(state,plantation,pcode,plot) select distinct state, plantation, pcode, plot from [Excel 8.0;database=c:\\abc.xls].[sheet1$]
select state, plantation, pcode, plot into into [Excel 8.0;database=c:\\abc.xls].[sheet1$] from PlotInfo,PlotMeasure,Tree where PlotInfo.state=PlotMeasure.state
这样可以实现数据的快速导入导出。
阅读(887) | 评论(0) | 转发(0) |