Hello all,
i had used the
elements function before to determine existence of an object in a collection, as follows:
Code:
select count(distinct t) from Topic as t, User as u where t = some elements(u.temas)
that worked fine and was done using postgresql dialect.
Now, however i tried to do something similar on ms sql dialect and didn't work:
Code:
select count(a) from A as a where not exists (from B as b where a = some elements(b.as) )
the native sql produced show that the elements function is returning all the properties of the table, not just the id:
Code:
select count(a0_.id) as x0_0_
from A a0_
where (not exists(
select a1_.id
from A a1_
where (a0_.id = some(
select ab.prop1, ab.prop2, ab.idA, ab.idB
from AB ab
where a1_.id=ab.idB))))
the point is to count the objects As, that don't belong to any B collection,
help will be deeply appreciated