table struct:
c1 c2
a 1
a 2
b 3
b 4
c 5
c 6
c 7
select结果:
c1 c2
a 1
b 3
c 5
在c1相同的情况下,c2可以任意值,例如:
c1是c,c2可以是5或6或7
c1 c2
a 1
a 2
b 3
b 4
c 5
c 6
c 7
select结果:
c1 c2
a 1
b 3
c 5
在c1相同的情况下,c2可以任意值,例如:
c1是c,c2可以是5或6或7
类似的问题
http://topic.csdn.net/u/20090907/11/b2fa1e4c-613a-44f5-8bdc-2682afc3486f.html?87532
(select c1,c2,row_number() over(partition by c1 order by dbms_random.random) rn)
where rn = 1;
(select c1,c2,row_number() over(partition by c1 order by dbms_random.random) rn from tablename)
where rn = 1;