PointCategory Table id pointname point_Category 1 xxx A 2 XCV B
EmployeeCategory Table id Employee_Id Emp_Category 1 mmm A 2 DDD B 3 XXX A
EmployeeStatus id Employee_Id EmpStatus_Id EndDATE 1 mmm 1 2015-2-132 mmm 2 2015-2-14 3 mmm 3 2015-2-15 4 XXX 1 2015-2-13 5 XXX 3 2015-2-12
Id pointCategory_Id Employee_Id DATE1 A mmm 2015-2-132 B XXX 2015-2-13
1.First Check Employee Category FROM employeeCategory table.Get A list of employee with same category. 2.then from EmpStatus table where multiple records against same employee are present ,get last record of all employee which have same category AND same EmployeeStatusType_Id as WE get in above point. 3.then check against each employee THAT we get from EmployeeStatus Table that if that Employee is allocated at point which has category "A" previously ,THEN allocate that Employee at a point WHICH HAS category "B".