2011-12-20 93 views
0
select (a.rowindx) rowindx, (b.rowindx) rowindx1 
from dedupinitial a, 
    dedupinitial b 
where a.rowindx < b.rowindx 
and a.poivalue = b.poivalue 
order by a.rowindx; 

複製該查詢給我造成像查詢查找重複與價值

rowindx rowindx1 
945 88715 
945 91674 
945 90947 
945 91013 
88715 91674 
88715 90947 
88715 91013 

但我想導致這樣的:

rowindx rowindx1 

    945 88715 
    945 91674 
    945 90947 
    945 91013 

什麼是查詢FOT是什麼?

回答

0

你只需要一分鐘(第一列),以及一組由(第二列)

select min(a.rowindx)rowindx, b.rowindx rowindx1 
from dedupinitial a, 
dedupinitial b 
where a.rowindx < b.rowindx --and a.rowindx 
and a.poivalue = b.poivalue 
group by b.rowindx 
order by 1; 

PS:我不理解和a.rowindx部分

+0

,這是錯誤的我有更新相同但您的查詢不起作用不會給GROUP BY表達式錯誤 – chetan 2011-12-20 13:52:31

+0

是的它的作品謝謝 – chetan 2011-12-20 13:58:11