Code
PointCategory Table
id pointname point_Category
1 xxx A
2 XCV BCode
EmployeeCategory Table
id Employee_Id Emp_Category
1 mmm A
2 DDD B
3 XXX ACode
EmployeeStatus
id Employee_Id EmpStatus_Id EndDATE
1 mmm 1 2015-2-13
2 mmm 2 2015-2-14
3 mmm 3 2015-2-15
4 XXX 1 2015-2-13
5 XXX 3 2015-2-12Code
Id pointCategory_Id Employee_Id DATE
1 A mmm 2015-2-13
2 B XXX 2015-2-13SQL
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".

Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Mar 20, 2015, 9:18 PM EDT
We can not find your query because some text are hidden .So please make visible your text.
Thanks.......
Sajid HussainRank #3,026 · 476 reputationPosted Mar 21, 2015, 2:43 AM EDT