In Oracle SQL, the CASE expression is used to add conditional logic within a SQL statement. It allows you to perform different actions based on different conditions. The basic syntax of the CASE expression is:
Here's an example to demonstrate how to use the CASE expression:
Suppose we have a table named employees with columns employee_id, first_name, last_name, and salary. We want to create a new column called salary_category that categorizes employees based on their salary into three categories: "Low", "Medium", and "High".