简体   繁体   中英

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". How would you create the query? I usually use the Design view to create query but i can understand SQL too.

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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