In the example below, how can I orderBy "amount" (which is an alias created by me using a subquery) in jooq? I cannot understand how to do it reading the documentation.
return context
.select(
NAME,
sum(
COLUMN_ONE.minus(COLUMN_TWO)
).as("amount")
)
.from(MYTABLE)
.groupBy(MYTABLE.NAME)
.fetchInto(MyClass.class);