【總結】去重的SQL

chncaesar發表於2013-12-04
1. Group-by,最簡單的辦法
select owner from all_objects group by owner;

2. 分析函式
select owner from (
select owner, row_number() over (partition by owner order by owner) rn
from all_objects

where rn=1;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/638844/viewspace-1062110/,如需轉載,請註明出處,否則將追究法律責任。

相關文章