新手求教:两张表合并 请问表A 有 NAME AGE 表B 有 NAME AGE 字段 A,B表结构完全一样如何把A,B表所有的记录合并到同样结构的表C中去,我刚学SQL,请前辈们帮忙给以个SQL语句,在线等,谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert Cselect * from a union all select * from b --如果C存在insert into cselect * from aunion allselect * from b--如果C不存在select * into c from(select * from aunion allselect * from b) t select * into C from (select * from A union all select * from B) tinsert C select * from A union all select * from B二选一 谢谢,表C存在,UNION ALL是不排重吧! insert C select * from A union all select * from B SQL初学者,如果学习SQL的一些相关请教 求一条SQL语句 问个题,统计个数 请问这句有什么问题?select sid,okMoney from cost where (select ssid,sum(smoney) from cost_sales group by ssid)>1000 通过6张表怎么生成另一张表?非常感谢!有点难度 这样的sql该怎么写? 怎么样将EXCEL的数据到入到SQL数据库的表中? 请教各位师兄,进者有分! 请问这条句你怎么写?谁写对了我会与你联系的。 表内的字符如果批量替换 问一句麻烦的插入SQL 一个存储过程执行上的问题
select * from a union all select * from b
--如果C存在
insert into c
select * from a
union all
select * from b--如果C不存在
select * into c from
(
select * from a
union all
select * from b
) t
from (select * from A union all select * from B) tinsert C
select * from A union all select * from B二选一
select * from A union all select * from B