This shows you the differences between two versions of the page.
dev:sql:functions:case [2009/12/04 22:20] tdo created |
dev:sql:functions:case [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
- | ====== Omnidex SQL Function: CASE ====== | ||
- | ===== Description ===== | ||
- | The CASE function handles simple IF - THEN - ELSE logic at a select-item level. The WHEN conditions are evaluated in order until a condition proves TRUE, at which point the THEN expression is executed. All of the THEN expressions in a CASE statement must be of the same data type: numeric, character, or date. | ||
- | ===== Syntax ===== | ||
- | CASE | ||
- | WHEN condition_expression THEN scalar_expression | ||
- | ELSE scalar_expression | ||
- | END | ||
- | |||
- | |||
- | ===== Example ===== | ||
- | ==== Example 1 ==== | ||
- | ==== Example 2 ==== | ||
- | |||
- | |||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |