https://kotlinlang.org logo
#exposed
Title
# exposed
d

danielm

05/31/2018, 2:04 PM
I want to get the distinct production names sorted by the first performance date for a given organization. But the code returns all production rows.
t

tapac

05/31/2018, 3:29 PM
You have to use grouping operation, not distinct.
Copy code
.slice(Production.name)
.select { Organization.id eq organizationId }
.groupBy(Production.name)
.orderBy(Performance.date.min())