[Cubicweb] RQL Question

Alexandre Fayolle alexandre.fayolle at logilab.fr
Sun Sep 25 18:44:00 CEST 2011


I have a schema defining 3 entity types Container, ContentA and ContentB, and 
a relation in_container. A container can contain 0 or more A and/or B, and I 
want to compute the number of ContentA and ContentB in my containers. 

Any C, Count(A), Count(B) WHERE A is ContentA, A? in_container C, B is 
ContentB, B? in_container C 

gives me obviously wrong results (some counts are higher than the total number 
of A and B in the db). Is there a way of computing this in a single query?

Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science

More information about the Cubicweb mailing list