SELECT emp_name, CASE WHEN emp_type = 0 THEN 'Temporary' WHEN emp_type > 0 AND emp_type < 5 THEN 'Permanent' ELSE 'UNKNOWN' END AS emp_type FROM employee;
SELECT emp_name, DECODE(emp_type, 0, 'Temporary', 1, 'Permanent', 2, 'Permanent', 3, 'Permanent', 4, 'Permanent', 'UNKNOWN')AS emp_type FROM employee;
No comments:
Post a Comment