Reputation: 33
I have a table like this:
Artist Image Title
Smith 2 Country
Smith 5 Town
Doyle 21 Cat
Lawlor 24 Ball
Jones 8 Cheese
Jones 12 Bread
Jones 15 Butter
And I want to set up a DISTINCT Query to return the Artist once - doesn't matter which of the records are returned. This is what I'm looking for:
Artist Image Title
Smith 2 Country
Doyle 21 Cat
Lawlor 24 Ball
Jones 8 Cheese
I am using ASP on a MS Access database.
Any help much appreciated.
Upvotes: 3
Views: 2306
Reputation: 453898
Access has FIRST
and LAST
aggregates which return the first or last record as it was entered in chronological order
SELECT Artist, FIRST(Image) AS Image, FIRST(Title) AS Title
FROM table
GROUP BY Artist
Upvotes: 2