cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <>
Subject Re: Ordering expression
Date Thu, 22 Jul 2010 18:19:58 GMT
Sorry, I misread your question.   You really want to do an ordering by
expression rather than by column.

There is a thread on this.

The short answer is that it's not supported.   There are a number of
workarounds, depending on the specific query and how you need to use

In your specific case, perhaps you could create a view containing A+B
as an additional column and sort on that column.

Or you can use an SQLTemplate to create the query.

I believe there were other workarounds in the thread above.

On Thu, Jul 22, 2010 at 2:13 PM, Mike Kienenberger <> wrote:
> On Thu, Jul 22, 2010 at 1:45 PM, Martin Ludeiro
> <> wrote:
>> I want to do an ordering expression with two columns, but i cant find
>> the way
>> The generated SQL must be something like "SELECT A, B FROM T ORDER BY A
>> + B";
>> Sorry for my bad english
>> Thanks in advance

View raw message