如何将查询后的记录存入另外一张表中 如何将查询后的记录存入另外一张表中 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into tbselect * from ta 同时生成tb新表select * into tbfrom ta insert into tb2 select * from tb2 INSERT TB SELECT * FROM TA --TB EXISTSSELECT * INTO TB FROM TA --TB NOT EXISTS --表不存在select * into tb2 from tb1--表存在insert into tb2 select * from tb1 --新表不存在select * into 新表 from 旧表where 查询条件--新表不存在insert into 新表 select *from 旧表where 查询条件 如果需要子查询.--表不存在select col into tb2 from (select * from tb1) t --表存在insert into tb2 select col from (select * from tb1) t --表不存在select * into newtable from tb--表已存在insert newtable(字段列表) select 字段列表 from tb MySQL插入操作出现1064错误。 求一带条件执行的触发器 mayi.sql导入错误,请高手指点!! 这样的排序如何实现? 求助,请问有没有一些智能化的索引重建?每次数据多了难到都DBCC DBREINDEX吗? 取字符 提一个很简单的存储过程问题,急用 数据库 查询数据中,在list控件中分页显示,应该如何处理。 表 table1和table2 中,怎样从table1中满足条件的记录追加到table2 求一查询语句 有点复杂 关于sql2005数据库恢复失败提示“exclusive access is denied。database in use”
select * from ta
select *
into tb
from ta
SELECT * INTO TB FROM TA --TB NOT EXISTS
select * into tb2 from tb1--表存在
insert into tb2 select * from tb1
select *
into 新表
from 旧表
where 查询条件--新表不存在
insert into 新表
select *
from 旧表
where 查询条件
select col into tb2 from (select * from tb1) t --表存在
insert into tb2 select col from (select * from tb1) t
--表不存在
select * into newtable from tb
--表已存在
insert newtable(字段列表) select 字段列表 from tb