披着海牛的狼是限定吗:sql筛选出来的记录怎么创建到一个新表中

来源:百度文库 编辑:高校问答 时间:2024/05/03 08:45:44
sql="select * from topic union select * from article union select * from head "
怎么将这三个表中的记录合并到一个新表中?新表如何创建?sql语句
谢谢了!

drop table 新表名 //select into必须是不存在的表,所以先删除
select into 新表名 * from topic union select * from article union select * from head

select * into 新表 from (select * from topic union select * from article union select * from head)