Question: I have 2 tables (table Mngr and VWE) I want my query returns the `table Mngr` records in which`w.Mdl` and `o.CM` are equal (all the models that are equal) but the o.cv does not exist in table VWE.

can anybody help me writing it?

```
     table Mngr                  table VWE
    ------------                -----------
    CM      CV                   Mdl     Vrs
    a       5                    a       1
                                 b       2
                                 a       3

```

HERE: I want it to return the row in table `Mngr` with `CM a and CV 5`, because the version 5 is new

would you please help me how can I write in using Linq?

```
var q = (from o in Mngr 
            from v in VWE
                .Where(w=>
                    w.Mdl == o.CM &&
                    w.Vrs != o.CV)
                    where o.Mod == 1
                    select o).distinct();

```

THANKS

Answer: 
You should check if none matching records exist in `VME` set:

```
Mngr.Where(m => m.Mod == 1 && !VME.Any(v => v.Mdl == m.CM && v.Vrs == m.CV))

```

Query syntax

```
from m in Mngr
where m.Mod == 1 !VME.Any(v => v.Mdl == m.CM && v.Vrs == m.CV)
select m

```
This should work for you, considering 

> 
> o.cv does not exist in table VWE
> 
> 
> 

```
var query = Mngr.Where(m => VWE.Any(v => v.Mdl == m.CM) && 
                            !VWE.Any(v => v.Vrs == m.CV));

```