SELECT COUNT(*)
FROM dbo.Table WITH (NOLOCK)
WHERE
Columnn1 IN (1,2) AND
Column2 IN
(SELECT id FROM dbo.Table2 WHERE id2 = 5 AND id3 = 1) AND
id4 = 8
views:
29answers:
1
A:
Context.Table.Count<TableObject>(t => t.id4 == 8 &&
(t.Column1 == 1 || t.Column1 == 2) &&
Context.Table2.Count<Table2Object>(t2 => t2.id2 == 5 && t2.id3 == 1 && t2.id == t.id) > 0);
where TableObject
and Table2Object
are whatever you named the entities coming from Table and Table2, respectively.
Andrew
2010-10-12 15:54:13