If what you are trying to do is retrieve only the emp_id and emp_name of the employees and you are not selecting any field from table2. You only need...
Try thisSELECT col1FROM table1 a Where a.col1 Not in(Select b.col1 from table2)group by a.col1
You can use PIVOT or you can use Case statements to do your move if you can.
Did you try thisselect distinct emp_id, emp_name from tblEmployee a inner join tblEmploy_type_link b on a.emp_id = b.emp_id inner join...
I would suggest you use the DATEADD function If you are trying to calculate the total in days, months, years etc...
Separate names with a comma.