turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bartek Walter <Bartek.Wal...@man.poznan.pl>
Subject Re: criteria.addAscendingOrderBy - Problem!
Date Wed, 10 Oct 2001 13:03:09 GMT
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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Mime
View raw message