select *
from impact
where (usedin&1)=1
and impactid not in
(select impactid
from responsetime
where scontractid= scontractid )
I am learning LINQ. I want to write this query in LINQ.
select *
from impact
where (usedin&1)=1
and impactid not in
(select impactid
from responsetime
where scontractid= scontractid )
I am learning LINQ. I want to write this query in LINQ.
I'm told that a SQL query like this will be faster.
select *
from impact i
left outer join responsetime r on i.impactid = r.impactid
where (usedin&1)=1
and scontractid= scontractid
and r.impact is null
Converting that to linq, we get:
from i in impact
from r in responsetime.Where(rr=>i.impactid = rr.impactid).DefaultIfEmpty()
where (i.usedin&1)=1
and i.scontractid= scontractid
and r.impact is null
select i