这种要求怎么用SQL在Access里实现

zx_soft 2009-04-28 11:53:42
insert into table1(A)
select 'A' where not exists (select 1 from table1 where A = 'A');
也就是有一组值,如果表里不存在,则插入,否则不插入
...全文
31 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zx_soft 2009-04-28
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ACMAIN_CHM 的回复:]
利用一下ACCESS的系统表,如下即可。


SQL codeinsert into table2(A)
select 'A' from msysobjects
where id=2 and not exists (select 1 from table2 where A = 'A');





[/Quote]
不行,这个系统表会有32行,不过可以利用这个想法
ACMAIN_CHM 2009-04-28
  • 打赏
  • 举报
回复

利用一下ACCESS的系统表,如下即可。

insert into table2(A)
select 'A' from msysobjects
where id=2 and not exists (select 1 from table2 where A = 'A');


7,712

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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