https://kotlinlang.org logo
d

danielm

05/31/2018, 2:09 PM
I've also tried something like .distinctBy { Production } but here only one row is returned.
t

Tristan Caron

05/31/2018, 2:26 PM
distincBy is a function provided by
kotlin.Collection
, not
exposed
. You tried what I answer you before?
d

danielm

05/31/2018, 2:59 PM
Still trying to wrap my head around it
t

Tristan Caron

05/31/2018, 3:02 PM
How would you write it using raw SQL?
d

danielm

06/01/2018, 4:12 AM
Hmm, I was not able to figure out an appropriate SQL statement
But your hit about collections helped a lot, thanks.
Just for the records I'm using now:
Copy code
...
.orderBy(Performance.date)
.map { it[Production.name] }
.distinct()
.forEach {
  println(it)
}
2 Views