提问。很简单。

geledazhang 2003-12-19 08:09:26
A表有字段 B表有字段
AA BB aa cc dd
01 20 01 2002 1 。。。。。。。。。。
02 70 02 2001 0 。。。。。
03 2001 8。。。。。。。。。
C表
AA BB
01 20
02 70
03 0 把B表的03数插入到A表,结构和C一样,然后BB字段插入0。
...全文
48 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shuiniu 2003-12-19
  • 打赏
  • 举报
回复
insert A表
select aa,0 from B表
where not exists(select 1 from A表 where 表B.aa = A表.aa)
txlicenhe 2003-12-19
  • 打赏
  • 举报
回复
insert A表 select aa,0 from B表
where aa not in (select AA from A表)

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧