SQL> with tt as
2 (select 'A' name, '英语' course
3 from dual
4 union all
5 select 'B', '数学'
6 from dual
7 union all
8 select 'A', '法语'
9 from dual
10 union all
11 select 'C', '语文'
12 from dual
13 union all
14 select 'D', '英语' from dual)
15 select name, course
16 from (select tt.*, row_number() over(partition by name order by rownum) rn
17 from tt
18 where name in ('A', 'B', 'C', 'D'))
19 where rn = 1;