Hi, You can try #set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='Photos.PhotoClass' and obj.name<>'Photos.PhotoClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.creationDate") or #set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='Photos.PhotoClass' and obj.name<>'Photos.PhotoClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.date") depending if you want to sort by the creation date or update date of the documents Ludovic Brian D. Switzer a écrit :
I'd like to select documents from the database by class via the following (based on the blog code):
#set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='Photos.PhotoClass' and obj.name<>'Photos.PhotoClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.name")
This is fine, but I'd like to sort the results by another of the parameters ("date") instead of by document name. I'm not a database person, so I'm not sure how to accomplish this. Any guidance would be most helpful.
--Brian D. Switzer e-mail: herkamur -=>at<=- canada -=>dot<=- com web: http://bswitzer.railfan.net/
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic