Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ambiguous columns not prefixed in nested queries #386

@sigmanil

Description

@sigmanil

In the following (which is an abbreviated real world example), the "nestedQuery" works fine on its own, and the query created has columns prefixed with tables etc. But when I, as below, send it in as a nested query to an upate, the prefixing of columns is gone, and the result is an error message saying ERROR: column reference "id" is ambiguous.

val nestedQuery = database.from(Table1)
   .innerJoin(Table2, Table2.table1Id eq Table1.id)
                .select(Table1.id)
                .where( /* something */ )

database.update(Table1) {
   set(it.something, someNewValue)
   where {
      it.id inList nestedQuery 
   }
}

Using postgres and Ktorm version 3.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions