在关系数据库(如MySQL)中,有表t_test,包含字段iname1, name2。表中数据如下: 'Tom','Amma' 'Tom','Jack' 'Tom','Jack' 'Alice','Mike' 'Alice','Tom' 'Alice','Tom' 表中有重复数据,现要将重复数据去除,得到如下的结果: 'Tom','Amma' 'Tom','Jack' 'Alice','Mike' 'Alice','Tom' 如下SQL语句能够实现的是?
A.select name1,name2 from ( select name1,name2,row_number() over(PARTITION by name1,name2 order by name1,name2) as rk from t_test ) a where rk=1 B.select name1,name2 from ( select name1,name2,row_number() over(PARTITION by name1,name2 order by name1,name2 desc) as rk from t_test ) a where rk=1 C.select name1,name2 from ( select name1,name2,row_number() over(PARTITION by name1 order by name1) as rk from t_test ) a where rk=1 D.select name1,name2 from ( select name1,name2,row_number() over(PARTITION by name2 order by name2) as rk from t_test ) a where rk=1