Oracle 查询重复记录的

列子:Select name,num from test where rowid!=(select max(rowid)

         from test b where b.names=test.names and

b.num=test.num);

 

---------------------------------------

-- 速度优化,前一语句比后一语句的速度快几十倍
select names,dates
from test,b
where test.names = b.names(+) and
      b.names is null and
      b.dates > date('2003-01-01','yyyy-mm-dd');


select names,dates
from test
where names not in ( select names
                       from b
                      where dates > to_date('2003-01-01','yyyy-mm-dd'));

posted on   呼嘎嘎  阅读(153)  评论(0编辑  收藏  举报

< 2012年9月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6

导航

统计

点击右上角即可分享
微信分享提示