简体   繁体   English

选项框表仅搜索 SQL (MS-Access) 上的号码

[英]Option box table only searchs with number on SQL (MS-Access)

I have made a table with placements.我做了一张有展示位置的桌子。 It says它说

  1. New York纽约
  2. Washington华盛顿

I use the table in another table and form where the user can select a city.我在另一个表和表格中使用该表,用户可以在select 中找到一个城市。 But when I try to query the selected value with SQL, I can only search on the ID.但是当我尝试用 SQL 查询所选值时,我只能搜索 ID。 Like

SELECT Articles.Name
FROM Articles
WHERE (((Articles.Placement.Value)=1);

I would like to search by name instead.我想改为按名称搜索。 How is that done?这是怎么做到的? I simply can't find any info on that anywhere.我根本无法在任何地方找到任何信息。

 SELECT Articles.Name
    FROM Articles
    WHERE (Articles.Placement="New York");

I think you just want a JOIN :我想你只是想要一个JOIN

SELECT a.Name
FROM Articles as a INNER JOIN
     Placements as p
     ON a.Placement_ID = p.Placement_Id
WHERE p.Placement = "New York";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM