LINQ to SQL を使用してデータセットを取得しています。このデータセットを次のようにフィルタリングする必要があります。
SourceName が null のフィールドが存在し、このフィールドに SourceName が null 以外のレコードが少なくとも 1 つある場合は、そのレコードを削除する必要があります。
それがその「フィールド」の唯一の行である場合、それはリストに残るはずです。
以下にデータの例を示します。データは 3 つの列で構成されています: 'Field'、'SourceName'、'Rate'
Field | SourceName | Rate
10 | s1 | 9
10 | null | null
11 | null | null
11 | s2 | 5
11 | s3 | 4
12 | null | null
13 | null | null
13 | s4 | 7
13 | s5 | 8
8 | s6 | 2
9 | s7 | 23
9 | s8 | 9
9 | s9 | 3
出力は次のようになります。
Field | SourceName | Rate
10 | s1 | 9
11 | s2 | 5
11 | s3 | 4
12 | null | null // <- (remains since there's only
13 | s4 | 7 // 1 record for this 'Field')
13 | s5 | 8
8 | null | null
9 | s8 | 9
9 | s9 | 3
フィルタリングするにはどうすればよいですか?