I have a phonenumber field like:

```
**phonenumbers**
0729643482
0723412678
0734231567
0745297334
0729643482
0720606706
0729643482
0720606706

```

There are thousands of entries. I wanted to get top 10 phonenumbers with greatest count.
this can be displayed as

```
**phonenumber     count**
0729643482      3
0720606706      2
.
.
.
(entry 10)      1

```

From some of the few related questions i understand i can use rank() then group by but i have never done this before.
Here is what i have:

```
select phonenumber,cnt FROM 
(select phonenumber, cnt, rank() over (partition by phonenumber order by cnt desc) rnk
from (select distinct phonenumber, count(phonenumber) cnt
            from ozekiout
            group by phonenumber
            order by phonenumber, count(phonenumber) desc) 
)
where rnk = 1;

```