I have 3 tables. 2 contain lists of files that I need to make UNION to get all unique files, then I want to make a left outer join with the third table to find all the files that are only in the third table, and not in the other 2.
To execute UNION, I have the following:
var imageUnion = (from img in dc.ImageT1
select img.filename).Union(
from img in dc.ImageT2
select img.filename);
Now, to get the files only in the third table, I would make a left outer join as such:
var query = from image in dc.ImageT1
join active in dc.ActiveImages on image.filename equals
active.filename into gj
from subimage in gj.DefaultIfEmpty()
where subimage.filename == null
select new { image.filename, image.size };
I understand how to make a left outer join just against ONE table, but how do I get the result set of my first query into a left outer join? Basically, instead of making a left outer join with ImageT1, I want to do this against the result of imageUnion.
Thanks!