我正在尝试重命名我选择的某个字段,但它并没有按预期正常工作。
这是我的代码
...
final List<Field<?>> fields = new ArrayList<>();
fields.add(field(name("inner_id"), String.class).as("id"));
fields.add(field(name("inner_name"), String.class).as("name"));
create.select(fields).from(view).where(whereClause, whereBindings);
...
转换为:
select "inner_id" "id", "inner_name" "name"
from table
where (inner_id = x)
而不是
select "inner_id as id", "inner_name as name"
from table
where (inner_id = x)
我错过了什么?
谢谢!