lejo

lejo

  • 0
  • 257
  • 0

Case Statement in Where condition Error

Nov 28 2022 12:22 PM

   select emp.* into #TempEmpList1 from (SELECT   row_number()over(partition by  Emp_ID order by Emp_ID desc) rn,* 
    from  #TempEmpList) emp where emp.rn<=
    (case when exists  (select Emp_noEligibleforSchoolFee from NSP113_EducationAllowanceMaster where Emp_ID= emp.Emp_ID ) 
     ELSE  
    emp.Emp_noEligibleforSchoolFee end  )

BOLD PORTION IS ERROR 

HOW TO CORRECT THIS WHERE CONDITION


Answers (3)