d

    danielm

    4 years ago
    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.
    tapac

    tapac

    4 years ago
    You have to use grouping operation, not distinct.
    .slice(Production.name)
    .select { Organization.id eq organizationId }
    .groupBy(Production.name)
    .orderBy(Performance.date.min())