对比三个表中的数据

wealsh 2006-02-20 03:17:36
有三个表A、B、C
A表中的数据是1、2、3、4、5、6、7、8、9、10
B表中的数据是9、3、1
C表中的数据是5、6
如何取得A-(B+C)的数据?
...全文
79 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangl_cn 2006-02-20
  • 打赏
  • 举报
回复
select F1 from A where F1 not in (select f1 from b) and F1 not in (select f1 from c)
wealsh 2006-02-20
  • 打赏
  • 举报
回复
出现“字查询中不允许此操作”
数据库是Access
wealsh 2006-02-20
  • 打赏
  • 举报
回复
有问题?
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add('select 机号 from klib where 机号 not in (select 机号 from jf union select 机号 from pc)');
open;
First;
while not Eof do
begin
ListBox1.Items.Add(FieldValues['机号']);
Next;
end;
Close;
end;
zhangl_cn 2006-02-20
  • 打赏
  • 举报
回复
select Field1 from A where Field1 not in (select Field1 from B union select Field1 from C)
wealsh 2006-02-20
  • 打赏
  • 举报
回复
读到Tsringlist再进行比较?这样比较麻烦啊
zhangl_cn 2006-02-20
  • 打赏
  • 举报
回复
不明白,各个表的数据和
wealsh 2006-02-20
  • 打赏
  • 举报
回复
是的
cuteant 2006-02-20
  • 打赏
  • 举报
回复
你的意思是得到2 4 7 8 10?

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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