I want to get the distinct production names sorted...
# exposed
d
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
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())