Android sqlite get largest value of a row among multiple entries : My question is similar to the following post:
https://stackoverflow.com/questions/35565309/find-largest-value-among-repeated-entries-in-an-sql-table

but it is for mysql and and I cannot understand how it translates in sqlite.

I want to get the max value of `pages` from my table `metadata` with multiple `file_ids` and multiple entries

  

My table with the two columns I am interested in. 

`file_id  pages
1          2
1          5
2          10
3          20 
4           12
4           1
5           4
6           5
6           14 
7           12`


What I am looking for is 

`file_id  pages
1          5
2          10
3          20 
4           12
5           4
6           14 
7           12`

I am trying to make a query but don't know how

String[]cols = {"file_id","pages"};
String groupBy = {"pages"};
all others params are null
that's as far as I can think.



What will be the query like. Please help.