设源表为testsource,目标表为testdestination;
将源表中的记录插入到目标表中
1. insert into ... select 语句:将源表中的记录插入到目标表中,假设目标表已经存在
1)若目标表和源表的结构一样
insert into testdestination select * from testsource
2)若不一样:就要指明要插入的字段名
insert into testdestination(id,name) select id,name from testsource
2.select...into...语句:将源表中的记录插入到目标表中,同时创建目标表,目标表的结构根据查询结果决定
select * into testdestination from testsource
select a.au_lname,c.title into authortitles from authors a, titleauthor b,titles c
where a.au_id=b.au_id and b.title_id=c.title_id