I am trying to get unique values from a table in oracle via sql. The table looks like this.
Table: ABC with columns name and value.
NAME Value
AA 10
B 40
CC 50
AA 70
DD 80
CC 90
EE 100
FF 120
GG 130
H 150
EE 170
I 180
J 200
K 210
L 300
GG 320
I want to grab the unique values from ABC for the column name and preferable the ones which have lower value number e.g. AA comes twice so i want to grab AA once but with the one with lower number in value.
SELECT DISTINCT
(NAME),
VALUE
FROM
ABC
ORDER BY
NAME ASC;
Please help. Thanks
1 Answer