user1593760
user1593760

Reputation: 71

Access query: show the first records

I have a table like this:

name1      | name2  | value1
-------------------------
Apple      | asdg   | 100
Apple      | ghf    |  50
Lemon      | dhjhgf |  60
Meat       | iop    | 300
Meat       | pdjs   |  70
Meat       | ncm    |  10
Strawberry | jdksa  |  20

What should I do to get this:

name1      | name2  | value1
----------------------------
Apple      | asdg   | 100
Lemon      | dhjhgf |  60
Meat       | iop    | 300
Strawberry | jdksa  |  20

Upvotes: 1

Views: 8648

Answers (1)

Neil Mussett
Neil Mussett

Reputation: 708

Access actually has the First function in queries, which makes it easy:

SELECT name1, First(name2) AS name2, First(value1) AS value1 FROM TheFruitTable GROUP BY name1

Upvotes: 0

Related Questions