Hi,
I am trying to do something like the following:
SELECT band_id, MAX(date_inserted) FROM
band_comment GROUP BY band_id ORDER BY 2
or
SELECT band_id, MAX(date_inserted) AS inserted FROM
band_comment GROUP BY band_id ORDER BY inserted
I am using a Criteria in the following way:
Criteria c = new Criteria();
c.addSelectColumn(CommentPeer.BAND_ID);
c.addAsColumn("inserted","MAX(" + CommentPeer.DATE_INSERTED + ")");
c.addAscendingOrderByColumn("inserted");
List comments = BasePeer.doSelect(c);
Executing this, a TorqueException will be thrown with the message:
Malformed column name in Criteria order by:
'inserted ASC' is not of the form 'table.column'
Does anyone know how to use a column in the 'order by' clause that
does not exist in the table?
greetings,
michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]