What version of Torque are you using?  This sounds like a duplicate of:

TRQS251: allow expressions in ORDER BY clause

http://issues.apache.org/scarab/issues/id/TRQS251

This bug is marked as fixed and should be in the last two RC versions.

> -----Original Message-----
> From: Mickey Mokotov [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 22, 2005 10:41 AM
> To: 'Apache Torque Developers List'
> Subject: Criteria.addDescendingOrderByColumn and column names
> 
> 
> Hi,
>  
> I think something is a bit weird with 
> Criteria.addDescendingOrderByColumn(String).
> It throws a TorqueException if you call it with a column name 
> without a "." in the middle, which is usually a good thing to 
> do, but it doesn't allow you to sort by a column you aliased 
> using "as".
>  
> For example - if you have a table UserReview, which holds 
> several entries per userId and you want to see the top 
> reviewers you'll have a problem: select UserReview.userId, 
> count(UserReview.userId) as count from UserReview order by count desc
>  
> I'm probably not the first one to have this problem, so I 
> might be missing something...
> 
>  
> -- 
>  <http://www.fetchbook.info/> www.FetchBook.Info
> Find the lowest price - Compare more then a hundred book 
> stores in a click.
>  
> 

Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are 
confidential communication or may otherwise be privileged or confidential and 
are intended solely for the individual or entity to whom they are addressed.  
If you are not the intended recipient you may not rely on the contents of this 
email or any attachments, and we ask that you  please not read, copy or 
retransmit this communication, but reply to the sender and destroy the email, 
its contents, and all copies thereof immediately.  Any unauthorized 
dissemination, distribution or copying of this communication is strictly 
prohibited.



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

Reply via email to