Raman Raman - 1 month ago 5
SQL Question

case not working in sql

select employee_size_range_id
from tbl_employee_size_range
where employee_range_values = '1 to 10'


in case:

SELECT employee_size_range_id,
employee_range_values,
CASE WHEN employee_range_values = '1 to 10' THEN 'employee_size_range_id'
FROM tbl_employee_size_range

Answer
 SELECT employee_size_range_id,employee_range_values,
   CASE WHEN (employee_range_values >= 1 AND employee_range_values <= 10) THEN 'employee_size_range_id' END FROM tbl_employee_size_range.employee_range_values
Comments