what am I missing?
# exposed
d
what am I missing?
t
Please share your tables mapping and join condition
d
Already the following code stitched together from the wiki does throw the exception:
Copy code
import org.jetbrains.exposed.dao.IntIdTable
import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.Table
import org.jetbrains.exposed.sql.count
import org.jetbrains.exposed.sql.select

fun main(args: Array<String>) {
    (Players innerJoin StarWarsFilms)
            .slice(Players.name.count(), StarWarsFilms.name)
            .select { StarWarsFilms.sequelId eq Players.sequelId }
            .groupBy(StarWarsFilms.name)
}


object StarWarsFilms : IntIdTable() {
    val sequelId: Column<Int> = integer("sequel_id").uniqueIndex()
    val name: Column<String> = varchar("name", 50)
    val director: Column<String> = varchar("director", 50)
}


object Players : Table() {
    val sequelId: Column<Int> = integer("sequel_id").uniqueIndex()
    val name: Column<String> = varchar("name", 50)
}
t
I see, there is a bug in wiki. When you use innerJoin without specifying columns, you should create reference between tables. ATM StarWarsFilms and Players are unrelated to each other. Try to replace
Players innerJoin StarWarsFilms
with
Players.innerJoin(StarWarsFilms, { Players.sequeld}. { StarWarsFilms.sequelId })
d
Thank you for the info.
Just for reference there were 2 typos in your code. It should be:
Copy code
Players.innerJoin(StarWarsFilms, { Players.sequelId}, { StarWarsFilms.sequelId })
t
I wrote it right in the slack:D Without verification, but I hope you understand the main idea.
d
Yeah, it's working, thanks