I have a table A{id, foo, ...} and a table B{id, boo, idA} I want All objects in A that the ids doesn't appear in B
in Oracle SQL would looks like:
SELECT id FROM A MINUS( SELECT idA FROM B);
MINUS function not exists in HQL, go here on paragraph 14.10 Expressions.
Try this:
SELECT id FROM A
WHERE NOT EXISTS
(SELECT 'X' FROM B WHERE B.idA = A.id)
Is easier than I supposed, I was focused in the minus
select a.id from A as a where a.id not in (select idA from B)
thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With