db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giulio Vezzelli" <giulio.vezze...@infolog.it>
Subject R: Problems with Criteria and ORDER BY
Date Thu, 23 Oct 2003 10:47:48 GMT
I think you can add the count column to the select query as Maurice suggested, but adding "AS
COUNTCOLUMN" to the count string, and then use the addAscendingOrderByColumn method with "COUNTCOLUMN"
as the parameter. Don't know if it will really work, just a suggestion...


Giulio Vezzelli
Infolog S.r.l.
Via Alfieri, 28
Modena - 41100
Telefono : +39-059-822446
Sito web : http://www.infolog.it
E-mail : giulio.vezzelli@infolog.it
 


> -----Messaggio originale-----
> Da: Michael Burschik [mailto:Burschik@lotto-berlin.de] 
> Inviato: giovedì 23 ottobre 2003 12.42
> A: 'Apache Torque Users List'
> Oggetto: AW: Problems with Criteria and ORDER BY
> 
> 
> 
> 
> > -----Urspr√ľngliche Nachricht-----
> > Von: Maurice Wijtten [mailto:mwi@lucka.nl]
> > Gesendet: Donnerstag, 23. Oktober 2003 12:43
> > An: Apache Torque Users List
> > Betreff: Re: Problems with Criteria and ORDER BY
> >
> >
> > Why don't just use       criteria.addSelectColumn("count(" +
> > PeerName.fieldconstant + ")");
> > The field constants usually include the tablename. (usually 
> you'll be 
> > able to find a column as a substitute for the * sign).
> >
> > Maurice Wijtten
> 
> The difficult part is the "order by" part. I want to order 
> the result set according to the "count(whatever)" column.
> 
> Regards
> 
> Michael Burschik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message