简体   繁体   English

Access 2013查询-选择第一行

[英]Access 2013 query - select 1st row

It seems a basic questions but after several hours and days, i'm still blocked. 似乎是一个基本问题,但经过几个小时又几天之后,我仍然被封锁。

As part of a query I would like to select some specific rows in a table (actually this table is already a query). 作为查询的一部分,我想选择表中的某些特定行(实际上该表已经是查询)。 As an example, rows are highlighted in the picture attached. 例如,行在所附图片中突出显示。 For each "batch", this corresponds to the row containing the lower "CountofVials" and is not a "Stability rack". 对于每个“批次”,该行对应于包含较低“ CountofVials”的行,而不是“稳定机架”。 How would you create the query? 您将如何创建查询? I usually use the Design view to create query but i can understand SQL too. 我通常使用设计视图来创建查询,但我也可以理解SQL。

table with rows to select in yellow 表格以黄色选择行

表格以黄色选择行

SELECT * 
FROM YourQuery a 
WHERE EXISTS (SELECT 1  
              From YourQuery b
              WHERE b.[Stability Rack] = False AND b.Batch=a.Batch
              GROUP BY Batch
              HAVING Min(CountOfVial)=a.CountOfVial  )

You cannot 'select' non-contiguous in Access. 您不能在Access中“选择”不连续的。 You can use a form and 'highlight' entire rows or individual values using conditional formatting. 您可以使用表单,并使用条件格式“突出显示”整个行或单个值。 There has been much posted on conditional formatting, so it would be best to just look it up. 关于条件格式已经发布了很多文章,所以最好只查找一下。

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

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