在线等一道面试题答案 两个结构完全相同的表a和b,主键为index,使用SQL语句,把a表中存在但在b表中不存在的数据插入的b表中 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into b select * from a where not exists(select * from b where a.index=b.index) insert bselect a.* from a left join b on a.index = b.index where b.index is not null 不知道行不? 都对 index 是保留字,要用[index] insert bselect * from aexceptselect * from b SQL codeinsert into b select * from a where not exists(select * from b where a.index=b.index)[/Quote] insert into bfrom awhere index not in (select index from b) insert into bselect *from awhere index not in (select index from b) insert into b select * from a where [index] not in (select * from b) insert into a select * from b where not exists(select 1 from a where a.[index]=b.[index]) 21世界裸身视频网聊真像大暴光2008-06-20 21:43 我在一个网站上看见一个大学生在网上视频时身上光光的好多人看呀,我看见这样的情况就找到了网站的管理员反映,但是我在那网站申请会员后发表了几篇文章后有看见了这样的一幕,我真的想不怎么通,我就一个一个房间找看,只要可以进的 房间都是这样的情况,我真想问管理员一天到晚在做什么,为什么这么多的色情视频 怎么没有发现呢,是他们怕生气了人气和收入还是真的没有去观察过,在这里我希望有正义感的朋友多多的发表你们的观点,让我们的网络生活更加美好!! 来源网站会员学习交流社区 http://51job.8bbs.cn 21世界裸身视频网聊真像大暴光2008-06-20 21:43 我在一个网站上看见一个大学生在网上视频时身上光光的好多人看呀,我看见这样的情况就找到了网站的管理员反映,但是我在那网站申请会员后发表了几篇文章后有看见了这样的一幕,我真的想不怎么通,我就一个一个房间找看,只要可以进的 房间都是这样的情况,我真想问管理员一天到晚在做什么,为什么这么多的色情视频 怎么没有发现呢,是他们怕生气了人气和收入还是真的没有去观察过,在这里我希望有正义感的朋友多多的发表你们的观点,让我们的网络生活更加美好!! 来源网站会员学习交流社区 http://51job.8bbs.cn set IDENTITY_INSERT b oninsert b(column1,column2,....) select * from a where index not in (select index from b) insert into a select * from b where not exists(select 1 from a where a.[index]=b.[index])同意. insert into b select * from a where not exists(select * from b where a.index=b.index) insert into b select * from a where a.index not in (select b.index from b) index应该用[index]或者"index"表示 insert into b select * from a where not exists(select * from b where a.[index]=b.[index]) insert b select * from a except select * from b 能解释下为什么要加index 吗? insert into b select a.* from a where not exists( select 1 from b where a.index=b.index ) LZ这个是对的,毋庸置疑结贴吧!insert into b select * from a where not exists(select * from b where a.[index]=b.[index]) 两个结构完全相同的表a和b,主键为index,使用SQL语句,把a表中存在但在b表中不存在的数据插入的b表中insert into b select * from (select * from a where a.index <>b.index )c insert b select * from a except select * from b 采用左外联接方式insert into b select * from (select a.* from a left outer join b on a.[index]=b.[index] where b.[index] is null) as c insert b select * from a except select * from b 支持这种。 insert b select * from aexcept select * from b insert into b select * from a where not exists(select * from b where a.index=b.index) as c 如何生成唯一标示,比如说用户注册的唯一id 一道SQL题,谢谢看下 建存储过程 实现 批量查询 如何产生不大于当前日期的随机时间? sql 查询后的结果怎么创建到新建的一张表里面? 请教一个如何快速更新表内所有记录的问题 联合主键? 附加数据库时错误如何解决? 请教 做一个有深度的搜索引擎 您好,关于sqlserver2000恢复误删除的表 关于返回浮点数类型的存储过程报错
select * from a
where not exists(select * from b where a.index=b.index)
insert b
select a.* from a left join b on a.index = b.index where b.index is not null 不知道行不?
insert b
select * from a
except
select * from b
SQL codeinsert into b
select * from a
where not exists(select * from b where a.index=b.index)
[/Quote]
insert into b
from a
where index not in (select index from b)
select *
from a
where index not in (select index from b)
我在一个网站上看见一个大学生在网上视频时身上光光的好多人看呀,我看见这样的情况就找到了网站的管理员反映,但是我在那网站申请会员后发表了几篇文章后有看见了这样的一幕,我真的想不怎么通,我就一个一个房间找看,只要可以进的 房间都是这样的情况,我真想问管理员一天到晚在做什么,为什么这么多的色情视频 怎么没有发现呢,是他们怕生气了人气和收入还是真的没有去观察过,在这里我希望有正义感的朋友多多的发表你们的观点,让我们的网络生活更加美好!!
来源网站会员学习交流社区 http://51job.8bbs.cn
我在一个网站上看见一个大学生在网上视频时身上光光的好多人看呀,我看见这样的情况就找到了网站的管理员反映,但是我在那网站申请会员后发表了几篇文章后有看见了这样的一幕,我真的想不怎么通,我就一个一个房间找看,只要可以进的 房间都是这样的情况,我真想问管理员一天到晚在做什么,为什么这么多的色情视频 怎么没有发现呢,是他们怕生气了人气和收入还是真的没有去观察过,在这里我希望有正义感的朋友多多的发表你们的观点,让我们的网络生活更加美好!!
来源网站会员学习交流社区 http://51job.8bbs.cn
insert b(column1,column2,....) select * from a where index not in (select index from b)
select * from a
where not exists(select * from b where a.[index]=b.[index])
select * from a
except
select * from b 能解释下为什么要加index 吗?
这个是对的,毋庸置疑
结贴吧!
insert into b
select * from a
where not exists(select * from b where a.[index]=b.[index])
select * from (select * from a where a.index <>b.index )c
select * from a
except
select * from b
采用左外联接方式
insert into b select * from (select a.* from a left outer join b on a.[index]=b.[index] where b.[index] is null) as c
select * from a
except
select * from b
支持这种。
except select * from b