我的慈善机构的Access数据库有2个志愿者表:
this.heroService.getHeroes().then(heroes => this.heroes = heroes.slice(1, 5));
我需要编写一个查询,列出对某个群组感兴趣但不属于该群组的人,并且完全陷入困境。任何帮助将不胜感激。感谢
答案 0 :(得分:0)
多值字段是一个麻烦,应该避免,但据我所知,这应该工作(它加入VolunteerGroups表两次,一旦在InterestGroups内部检查该人在该组,并一旦离开ActiveGroupss所以你可以检查该人不在该组中)
SELECT VID
FROM Volunteers
Inner Join VolunteerGroups As InterestedGroup ON InterestedGroup.ID = InterestedGroupss.Value
LEFT JOIN VolunteerGroups As ActiveGroup ON ActiveGroup.ID = ActiveGroups.Value
WHERE ActiveGroup.ID Is Null