I need some help for a query that – I believe – ne...
# exposed
g
I need some help for a query that – I believe – needs a sub query. I have two Entities:
Job
and
Part
with a one-to-many relation (one Job, many Parts) Each
Part
can have a field called
xxx
that can be either
true
or
false
I want a query for jobs (that’s easy) and in the result set I want to know if any of the parts have the parameter
xxx
set to true. So, one row for each
Job
– with a boolean field, if any
<http://Part.xxx|Part.xxx>
is set to true. How’s that done? Thank you for your help
d
Do I understand the requirement correctly and that would be an EXISTS query in plain SQL?
g
Yes, I think so. Or an Sub-Select with ‘WHERE xxx = true DISTINCT’ that returns either one true or null (which whould be okay)