Kotlin Room Database: How to save result from sum query?
I´m new to Kotlin and trying to learn it by programming an app for work time recording.
I´ve created a room database which works fine when inserting data. In the next step I would like to retrieve the sum of a column and store this value in a variable. And this is the point where I get stuck. Here are the affected snippets of my code.
data class sumPojo(var sumOvertime: Double)
@Dao
interface OvertimeDao {
@Query(value = "SELECT SUM(overtime) as sumOvertime FROM...