You need to add some joins select distinct max(prop.value) from BaseObject as obj, LongProperty as prop where obj.className='XWiki.CFPClass' and obj.id=prop.id.id and prop.name='id' Ludovic Xavier MOGHRABI wrote:
With the following query : #set ($sql = "select distinct max(prop.value) from LongProperty as prop where prop.name='id'") I get "2".
Thus I can get the last id. But how can I know that the "id" property belongs to my Class 'CFPClass' ? If there were an other class with the id property, perhaps I wouldn't have the same result ?
Can someone explain me how should I explain that I want "the last value of the property id of my class CFPClass" ?
Thanks
------------------------------------------------------------------------
-- 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