# CASE Keyword

### Description

-   Implements conditional logic, returning different results based on conditions
-   If no conditions are true, it returns the value in the ELSE clause

### Syntax

```sql
CASE
    WHEN condition1 THEN result1
    WHEN condition2 THEN result2 ...
    ELSE result
END;
```

### Example

```sql
SELECT
  e.id,
  e.full_name,
  CASE
    WHEN e.start_date < DATE(2020, 01, 01) THEN 'BEFORE_2020'
    ELSE 'AFTER_2020'
  END
FROM
  rippling.employee.Employee e;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/case

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
