Skip to content
Advertisement

Write query with HAVING clause in Kotlin with Exposed

I have written an SQL query in which I use the HAVING clause.

However, I have not found practical examples of the use of HAVING in the Exhibited documentation.

My query should return the following:

  • Disputes for an order that has the most recent status of ‘CAPTURED’ or ‘EXPIRED’

My biggest difficulty is writing the HAVING sub query. I saw that there is a function called wrapAsExpression, but I can’t use it in this scenario. My query so far looks like this:

I don’t know what else to do to make it work.

Advertisement

Answer

sorry for the delay! You are the man! Saved my development!

I made some adaptations to your suggestion.

My solution was as follows:

And the final code for the query:

Thanks a lot for the help . Hope I can help other people.

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