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
Jignesh KumarPosted Nov 28, 2022, 12:36 PM
Hello,
You are missing then in Case when ?? Then Else ?? End
Refer :
https://stackoverflow.com/questions/18099514/where-case-when-statement-with-exists
Vishal JoshiPosted Nov 28, 2022, 12:36 PM
Hello Lejo,
It looks like a case statement syntax issue. there must be Than after When condition.
Please try the below query it should work.
Thanks
Aravind GovindarajPosted Nov 28, 2022, 12:30 PM
can you paste the error message pls