一个简单的问题,怎么写啊 现有一表,里面有多个重复的纪录,如 a b 1 A 1 A 2 B 2 B
我现在要的是 1 A 2 B 就是把重复的去掉,请各位大侠指教!
------解决方案--------------------
SQL code
select distinct t.a,t.b
from
(select '1' as a,'A' as b from dual
union all
select '1','A' from dual
union all
select '2','B' from dual
union all
select '2','B' from dual )t
--------------------------------
A B
1 1 A
2 2 B