Skip to content
Advertisement

Get the max value using kotlin-exposed

I want to simulate this query using kotlin exposed framework:

JavaScript

I tried the next one query:

JavaScript

But this query just results in:

JavaScript

and the max value is selected in the code.

How to perform finding max value on the side of the database and map it to Int?

Advertisement

Answer

I tried similar query and I believe it fits your need.

The query is:

JavaScript

And it generates SQL query:

JavaScript

Your query can be used as:

JavaScript

Alternative, for extracting one value seems more appropriate:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement