Как выбрать группу по столбцу с псевдонимом? Я использую kotlin -экспонированный.
fun getSubscribeInfoByRoleName(roleName: String): List<SubscribeInfo> {
return SchemaSubscribersTable.join(SchemaVersionScheduleTable, JoinType.INNER, null, null) {
SchemaSubscribersTable.schemaName eq SchemaVersionScheduleTable.schemaName }
.slice(SchemaSubscribersTable.roleName, SchemaSubscribersTable.schemaName, SchemaVersionScheduleTable.version.max().alias("currentVersion"))
.select { SchemaSubscribersTable.roleName.eq(roleName) and SchemaVersionScheduleTable.applyAt.less(CurrentDateTime()) }
.groupBy(SchemaSubscribersTable.roleName,SchemaSubscribersTable.schemaName)
.map {
SubscribeInfo(
roleName = it[SchemaSubscribersTable.roleName],
schemaName = it[SchemaSubscribersTable.schemaName],
currentVersion =it[/*How can I select currentVersion*/]
)
}
}