-- Different Ranking functions usage
select rowid,Row_number() over(partition by A,B order by SAL asc) top1 FROM emp
select e.* ,rowid,DENSE_RANK() over(partition by A,B order by SAL asc) top1 FROM emp e
select e.*,rowid,RANK()over ( partition by A,B order by sal asc ) top1 FROM emp e
select e.*,rowid,CUME_DIST()over ( partition by A,B order by sal asc ) top1 FROM emp e
select e.*,rowid,PERCENT_RANK()over ( partition by A,B order by sal asc ) top1 FROM emp e
select e.*,rowid,NTILE(2)over ( partition by A,B order by sal asc ) top1 FROM emp e
Wednesday, April 18, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment