I have a table looking like:

```
user    books
a       aa
a       ab
a       ab
a       ac
a       ac
a       ac
b       aa
b       aa 
b       aa
b       ac
c       aa
c       aa
c       ab
c       ab
c       ab

```

I want an aggregated fields that has the count fo unique books per user - and I want to show the top 2 of them, in a descending order, meaning:

```
user    book    count  
a       ac      3
a       ab      2 
b       aa      3
b       ac      1
c       ab      3  
c       aa      2

```

I'm using sqlite.

In postgres I would you over partition by, but I don't think there's an equivalent in sqllite.
Any suggestion?