Hi, have you tried the following:
Criteria criteria = new Criteria(); criteria.add(GalleryPeer.VIEWS, "max(" + GalleryPeer.VIEWS + ")"); List result =GalleryPeer.doSelect(criteria); Thomas "Trevor Miller" <[EMAIL PROTECTED]> schrieb am 06.07.2006 07:46:13: > Hi All, > > I have been scratching my head trying to figure out how to do the following: > > "SELECT * FROM gallery WHERE views=MAX(views);" > > In other words, I want to find the gallery with the most views. > > Any suggestions on how to achieve this with Torque 3.2 and MySQL would be > greatly appreciated. > > Regards, > Trevor > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]