Jump to content

Pre-projecting nested data


Justin Porter

Recommended Posts

Hey all,

I'm trying to gather the names of lists with a specific custom attribute that shots belong to. My question is two-fold:

1) Is there a way to return JUST the values I'm after in these queries?

For example in the query below,  from each shot I want only the lists with the "flagRV" attribute returned. Right now it returns all lists associated with the shot:

select name, project.name, project_id,
lists.name, lists.custom_attributes
from Shot
where
project.name = {0} and
name in ({1}) and
lists.custom_attributes any (key is "flagRV" and value is "True")

In this next query, I've reversed the logic to lookup by lists, but only want items (shots) returned that are mentioned in the query - right now it returns ALL items/shots in the resulting lists:

select name, project.name, project_id, items.name
from TypedContextList
where
project.name = {0} and
custom_attributes any (key is "flagRV" and value is "True") and
items any (name in ({1}))

 

2) Assuming the answer to my first question is NO, is there a way to pre-project data for nested items? With the queries above, only the shot/list ids are returned, even though I'm trying to explicitly return the names. In this scenario, lazy queries are not an option, so the data has to be pre-projected.

 

Thanks! :)

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...