I want to write PQL that gives me number of instances of object type O1 which is related to n instances of object type O2. Ex: Number of Purchase Order which is related to 2 instances of payment. There is no 1:N relation between these table. In this scenario, is it still possible to get number of instances of one object based on how many times it is related to other object type?
Page 1 / 1
I think your solution will be including PU_COUNT and some case when. Question is: why is there no relationship if you want to bring them together now? DOMAIN_TABLE could be of help to bring the relationship together in runtime.
A first draft might if there is a relationship would be:
COUNT(CASE WHEN PU_COUNT(O1, O2.ID) =2 THEN 1 END)

Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.