OQL to join on two entities from two different associations.
0
Hi all, I have an entity called A, A has association with A1. Based on values provided by the user need to give results matching attributes of A1.Name='Name', like this. There is one more table called Allow which has associations with A1. Whatever combinations of A1are with A, should exist in Allow table also. Select a.Amount From AB.A as a JOIN a/AB.A_A1/AB.A1 as a1, JOIN AB.Allow as allow JOIN allow/AB.Allow_A1 as aa1 on aa1.Name=a1.Name Where a1.Name='test' Group By a.EffectiveDate Getting run time error as follows. An error occurred while executing OQL: unexpected token: INNER Am I missing some thing here ? TIA.
asked
Mahendra Anipireddy
1 answers
0
I guess you could just inner join from a1 to allow. Also the group by does not make sense if it's not in the select part. This will select amounts from A if it's associated with an A1 with Name = 'test' where the A1 is associated with an Allow.
SELECT a.Amount
FROM AB.A as a
INNER JOIN a/AB.A_A1/AB.A1 AS a1 ON a1.Name = 'test'
INNER JOIN a1/AB.Allow_A1/AB.Allow AS allow