削除する特定のコードを除外したい次のクエリがあります。これは給与プログラム用であり、それを実行しているユーザーに応じて、ユーザーリストの下の従業員の削除のみを許可する必要があります。
IEnumerable<int> employeeIdList; <----contains employee Ids under a certain user
var processDataTemps = tempProcessDataService.GetAllProcessDataTemps();
上記のクエリのサンプル結果
Code Name U_Employee_ID U_month U_PD_code U_Amount U_Balance U_taxyear
0 0 1 2 SYS037 24308.500000 0.000000 2013
1 1 1 2 SYS014 50470.000000 0.000000 2013
10 10 8 2 SYS024 7541.000000 0.000000 2013
13 13 7 2 SYS037 7541.000000 0.000000 2013
17 17 7 2 SYS024 7541.000000 0.000000 2013
私の質問は、processDataTempsクエリを変更してCode
、IEnumerableのemployeeIdListに含まれている従業員IDのみのコード(列)を返す方法です。
つまり。従業員IdListに1と7のみが含まれている場合、変更されたprocessDataTempsクエリはCode
値0、1、13、および17を返す必要があります。(SQLServer 2008を使用)