cancel
Showing results for 
Search instead for 
Did you mean: 

LEFT JOIN QUERY RESULT GROUP BY OR DISTINCT

Rafael_Bueno
Confirmed Champ
Confirmed Champ

Hi!

Can someone help me ? I'm trying to make a LEFT JOIN QUERY, but the query return duplicate result. Its possible make a DISTINCT or GROUPBY ? Why the query return the JOIN values to ? The result dont need to show me only F.cmis:objectId as ID, F.cmis:name as name this columns ?

SELECT F.cmis:objectId as ID, F.cmis:name as name  FROM arizona:file:business F
LEFT JOIN arizona:relationship:copyrights RFC ON RFC.cmis:sourceId = F.cmis:objectId 
LEFT JOIN arizona:copyrights C ON C.cmis:objectId = RFC.cmis:targetId 
LEFT JOIN arizona:copyrights:permission P ON P.arizonaCopyrightsPermission:copyrightsId = C.cmis:objectId 

alt text

5 REPLIES 5

Florent_Guillau
World-Class Innovator
World-Class Innovator

The CMIS Query Language does not support DISTINCT or GROUP BY. See the spec § 2.1.14.2.1 BNF Grammar.

Nuxeo returns the object id and type for each joined document because this has proven to be very useful, and is used internally. Why is it a problem? The tool that is going to consume that data will only keep what it needs anyway.

Florent, do you know how resolve that using some other strategy ? Do you know something about the other questions ?

Answer edited.

I cant create the max itens to the paginate

De-duplicate in your client.