注册 登录
编程论坛 SQL Server论坛

多表查询之后怎么把这个查询结果存入到另一张表里。

kgdipbyve 发布于 2009-08-16 10:09, 1278 次点击
我有3张表  A B C
我查询 A,B表
代码:
select team_url from [a] where team_url not in(select team_url from [b]))
这段是得到 A表跟B表中不相等的数据TEAM_URL
然后把这个得出Team_url 存入到C表中。
这个代码应该怎么写网上查到的试用都没用
1 回复
#2
happynight2009-08-17 16:49
给个C的基本结构也好啊
 假设你的C表中也有字段 team_url
 INSERT INTO C(team_url)
 select team_url from [a] where team_url not in(select team_url from [b]))
1