SELECT [Household Info].[Household Head], [Household Info].Gender, [Household Info].[Household Members], Count(IIf([Household Members.Gender]="Male",0)) AS [Total Male], Count(IIf([Household Members.Gender]="Female",0)) AS [Total Female], Count(IIf([Household Members.Gender]="M","Male","Female")) AS [Total Gender], [Household Data].[Area of Homelot (ha)], [Household Data].[Area of Farmlot (ha)], [Household Data].[Area of Homelot (ha)]+[Area of Farmlot (ha)] AS [Total Area Occupied], [Household Data].[Date of Occupancy]
FROM [Household Data], [Household Info] INNER JOIN
[Household Members] ON [Household Info].HID = [Household Members].HID
GROUP BY [Household Info].[Household Head], [Household Info].Gender, [Household Info].[Household Members], [Household Data].[Area of Homelot (ha)], [Household Data].[Area of Farmlot (ha)], [Household Data].[Area of Homelot (ha)]+[Area of Farmlot (ha)], [Household Data].[Date of Occupancy];
这是我在 MS ACCESS 中查询的输出
我想消除这两个重复值,因为这应该只是 1 个 Grace Poe、1 个 PPeter Caapegsan 和 1 个 Rodrigo Duterte。
是的,应该只显示 3 个数据,但我不知道为什么会重复。
最佳答案
尝试使用主键。就像把它(例如)放在 reference_numb 列(ex 1 gracepoe 2 Ppeter Caapegsan 3 Rodrigo duterte)你的 reference_numb 是数字(基于我的前任)和主键。名称可能是您的列 full_Name,这样您就无法插入具有相同引用编号的数据
关于c# - 如何使用 MS ACCESS QUERY 消除重复值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37451291/