Problem in case statement in sql
Posted on 2014-10-01
Question : Select first_name, incentive amount from employee and incentives table for all employees even if they didn't get incentives and set incentive amount as 0 for those employees who didn't get incentives.
My Query is :
select first_name, case Incentive_amount when null then 0 end from Employee_Table left join incentive on Employee_Table.EMPLOYEE_ID = incentive.EMPLOYEE_ID