I have a problem :( I have a table with many tables between two tables (1 & 2), through a mapping table (3):
(1)Trees / (2)Insects TreeID <- (3)TreeInsects -> InsectID
And then the one-to-many relationship:
Trees.ID -> Leaves.TreeID
And I would like to fulfill a query that will give me all Sheets for a collection of insects (through the display table of insect trees).
eg. I have a List<Insects> , and I want all the Sheets to have a link to any of the Insects in the List through the Tree-Insects mapping table.
This seems like a simple task, but for some reason I am having problems with this!
The best I have: but Single () makes it wrong:
from l in Leaves where (from i in Insects select i.ID) .Contains((from ti in l.Tree.TreeInsects select ti.InsectID).Single()) select l;
source share