I'm not entirely sure how to phrase what I mean. Let me try: Is there a way to select all elements that cascade by a reference field?
For instance, I have the rows:
parentRef | Reference | Data ------------------------------ aContainer | mainObj | "Parent" mainObj | secondObj | "Child 1" secondObj | thirdObj | "Child 2" nonExistent | blankObj | "Don't select me!"
And I want to select mainObj, secondObj, thirdObj in a single statement when I only know one parentRef: "aContainer". Is this possible?
I could do this by having my code perform many queries: select...where parentRef = 'aContainer'
, then select...where parentRef = 'mainObj'
, etc, but I really don't want to hammer my DB with many queries, primarily for speed.
Edit: Tree Queries! That's the search term I needed.