Gold
Gold

Reputation: 62464

Sorting query in access returns incorrect result

sorting in access Returns incorrect result

ID | Name
=======
1  | D
2  | D
3  | D
4  | A
5  | A
6  | C
7  | C

i need to sort by ID - but show only one Name.

ID | Name
=======
D
A
C

i try this:

select Distinct Name from MyTbl

Returns incorrect result

A
C
D

Upvotes: 0

Views: 133

Answers (1)

Gold
Gold

Reputation: 62464

i solved it !!

SELECT MyTbl.Name
FROM MyTbl
GROUP BY MyTbl.Name
ORDER BY Min(MyTbl.ID)

Upvotes: 1

Related Questions