[Cubicweb] straight forward filtering and ordering in the same rql sentence
carlos.balderas at gmail.com
Tue Sep 13 16:06:52 CEST 2011
I have the following schema:
Reference done_for Company
cardinality = '?*'
This means that a "Company" can have several "References" which is the
important point for this question.
What I would like to do is to make a company list ordered by the newest
modification date of its reference.
This rql sentence achieves what I am looking for :
Any C, MAX(RD) GROUPBY C ORDERBY 2 DESC WHERE R done_for C, R
But I would like to know if you have any other suggestions to build the rql
I have already tried this one:
DISTINCT Any C ORDERBY RD DESC WHERE C is Company, R done_for C, R
but I get this error:
** can't sort on variable RD which is linked to a variable in the selection
but may have different values for a resulting row
Any comment will be very appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cubicweb