求一SQL,各位救命呀.解决就给分.决不含糊.

liaorui liaorui 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
两个表 temp 和 temp1
temp表结构:
aa bb
1111 1111
1111 2222
1111 3333
1111 4444
2222 1111
2222 2222
2222 3333
2222 4444
3333 1111
3333 2222
3333 3333
3333 4444
create table temp(aa nvarchar(4),bb nvarchar(4))
insert into temp values('1111','1111')
insert into temp values('1111','2222')
insert into temp values('1111','3333')
insert into temp values('1111','4444')
insert into temp values('2222','1111')
insert into temp values('2222','2222')
insert into temp values('2222','3333')
insert into temp values('2222','4444')
insert into temp values('3333','1111')
insert into temp values('3333','2222')
insert into temp values('3333','3333')
insert into temp values('3333','4444')

temp1表结构
cc bb
1111 2222
1111 3333
1111 4444
2222 1111
2222 3333
2222 4444
3333 1111
3333 2222
3333 4444
create table temp1(cc nvarchar(4),dd nvarchar(4))
insert into temp1 values('1111','2222')
insert into temp1 values('1111','3333')
insert into temp1 values('1111','4444')
insert into temp1 values('2222','1111')
insert into temp1 values('2222','3333')
insert into temp1 values('2222','4444')
insert into temp1 values('3333','1111')
insert into temp1 values('3333','2222')
insert into temp1 values('3333','4444')

返回结果:
1111 1111
2222 2222
3333 3333
也就是说通过SQL返回Temp表里有但Temp1表里没有的记录.
如果不清楚题目的可以加我
QQ:29239212
MSN:jeffery_liao@hotmail.com
谢谢各位了!!
...全文

相关推荐

评论 17
收藏 已收藏
分享
返回顶部