I would like to get the average of a column using Kotlin Exposed.
object MyTable: IntIdTable("MyTable") { val score = integer("score")val result = MyTable.slice( MyTable.score.avg().alias("avg_points")).first()
How do I get the result?
For normal columns I would use
result[MyTable.score]
But now it is an aggregate with an alias. I've tried
result["avg_points"]
But that fails. I don't see many public methods on ResultRow
.