For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

CASE Keyword

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

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

Syntax​

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

Example​

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;