访问:比较来自不同表的数字
ACCESS: Compare numbers from different tables
我不太了解Microsoft Access,但我需要它来解决这个问题:
假设我有两个 tables:
Table答:
Zipcode Start | ZipCode End | Etc1 | Etc2
==============================================================
20000-000 | 29999-999 | Sample data 1 | Another Sample 1
30000-000 | 39999-999 | Sample data 2 | Another Sample 2
40000-000 | 49999-999 | Sample data 3 | Another Sample 3
Table乙:
NAME | ZipCode | Etc1 | Etc2
=============================================
John Doe | 31564-888 | |
Johnny | 22559-010 | |
James | 44411-000 | |
如何比较 table B 的邮政编码与 table A 的指定范围?和return匹配的"Etc1"和"Etc2"?
谢谢大家!!
你可以这样做:
Select
TableB.Name,
TableB.ZipCode,
TableA.Etc1,
TableA.Etc2
From
TableA,
TableB
Where
TableB.ZipCode Between TableA.[ZipCode Start] And TableA.[ZipCode End]
我不太了解Microsoft Access,但我需要它来解决这个问题:
假设我有两个 tables:
Table答:
Zipcode Start | ZipCode End | Etc1 | Etc2
==============================================================
20000-000 | 29999-999 | Sample data 1 | Another Sample 1
30000-000 | 39999-999 | Sample data 2 | Another Sample 2
40000-000 | 49999-999 | Sample data 3 | Another Sample 3
Table乙:
NAME | ZipCode | Etc1 | Etc2
=============================================
John Doe | 31564-888 | |
Johnny | 22559-010 | |
James | 44411-000 | |
如何比较 table B 的邮政编码与 table A 的指定范围?和return匹配的"Etc1"和"Etc2"?
谢谢大家!!
你可以这样做:
Select
TableB.Name,
TableB.ZipCode,
TableA.Etc1,
TableA.Etc2
From
TableA,
TableB
Where
TableB.ZipCode Between TableA.[ZipCode Start] And TableA.[ZipCode End]