selecting max value from the rank function.
817257Oct 8 2012 — edited Oct 8 2012hi i have the following querry on the user table :
select user_id,email,
rank() over (PARTITION BY Email order by user_id ) AS rank_l
from users_tab;
it gives me the result as follows:
user_id email rank_l
1 a@a.com 1
2 a@a.com 2
3 b@b.com 1
4 b@b.com 2
5 c@c.com 1
6 c@c.com 2
7 c@c.com 3
i need to select the max rank user id only from the result set.
in this case the result that i should get is :
user_id email rank_l
2 a@a.com 2
4 b@b.com 2
7 c@c.com 3
please help ?