I have a salary legacy system, which was designed in some strange way (it was adabas database/ non-relational database).
I import tables to SQL database server, so the table tblMonthlyTransaction has a column named trnsDeductionCodes contains all the deduction codes for a specific person combined together.
So person No# 1 has these deduction codes” 545801702903904321” which really means that he has deduction codes No# 545, 801, 702, 903, 904 and 321. Three digits for each deduction code.
And remember that the code No# “545” some months appears in the beginning of the field, and some times not.
Which select statement should I have to use to retrieve only the people that have particular deduction code at specific month “transactionMonth”.
I have 8 million records in that table “tblMonthlyTransaction”, and I need to have only those people having deduction code No# 545 only, and for month No# “012013”.
Help me please.
I have some sample data to illustrate tables and data structure. See attached excel sheet please.salaryQuestion.xlsx