FO> Hi folks,

FO> we have a problem with inserting a special ORDER BY. We try to generate the
FO> following SQL-statement (excerpt):

FO> ... ORDER BY SUBSTR(TEILE.TNR,4,3),TEILE.TNR

FO> Using   addAscendingOrderByColumn generates an error.
FO> Any ideas on generating the statement with criteria?

I am not sure, but many databases (Oracle?) will treat such query as an
error since 'order by' cols must be 'select-ed' first.
Try this way:

select (...), SUBSTR(TEILE.TNR,4,3) as some_expression
from some_table
order by some_expression;

This one probably is easier to express in Criteria language
(criteria.addAsColumn() or similar)

Bartek Walter



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to