vendredi 11 décembre 2015

Join not working properly

I am inserting value into the table like below

  INSERT INTO p_leave_allocation_11122015(Mkey, Entry_Sr_no, Comp_mkey,FDepartment_Id,FModule_Id,Year, Emp_mkey, Emp_card_no, U_Datetime, Delete_Flag,Month12,PL_Days,)
   SELECT ROW_NUMBER() OVER(ORDER BY p_leave_allocation.MKey) + 1643,  
    ROW_NUMBER() OVER(ORDER BY Entry_Sr_no) + 898, Comp_mkey,FDepartment_Id,FModule_Id,
   '2016',Emp_mkey,Emp_card_no,U_Datetime,Delete_Flag,Month12,0 
   FROM p_leave_allocation lev 
   where  Emp_mst Emp left join p_leave_allocation and  Emp.status in ('A','S') 
   and Year(Emp.Date_Of_Joining) = '2015' 

but getting error as

An expression of non-boolean type specified in a context where a condition is expected, near 'Emp'.

what is wrong here ?

Aucun commentaire:

Enregistrer un commentaire