Hi everyone, how to get max value using room? More...
# room
r
Hi everyone, how to get max value using room? More details in thread
Lets say I have a table
Copy code
data class User(
val name: String,
val age: Int,
val city: String)
Now i want max age in a city
Copy code
SELECT MAX(age), city from User group by city
How do I do this?
p
This is a SQLite question, not a Room question I believe
Depending on the query, you might need to use the
@RawQuery
annotation in room in your DAO function
279 Views