please consider this scenario:
I have a table like this:
ID City Status
--------------------------------------
1 1 1
2 1 1
3 1 1
4 2 1
5 2 0
6 3 1
7 3 1
8 3 1
9 3 1
10 4 3
11 4 1
12 4 0
I want to return Citis that all records that related to that city have Status=1 and if one of that records has Status<>1 that city exclude from reslut set. in this scenarion I want to return cities : 1 , 3.
How I can do this with Sql Query or LINQ query?
thanks
Something like this should do it.
LINQ:
SQL:
Hope this helps.