Αποτελέσματα Αναζήτησης
The CASE expression provides conditional SQL expressions. You can use case expressions anywhere you can use an expression. The syntax of the CASE expression is as follows: CASE expression . WHEN expression THEN expression [, …] [ ELSE expression ] END. You cannot use a subquery as a value expression in a CASE statement.
- If Expressions
IF expressions. The syntax of the IF expression is as...
- Compatibility of Expressions
Compatibility of expressions. Table 2-2 and Table 2-3...
- CASE statement
The CASE statement is a control statement that lets you...
- If Expressions
7 Ιαν 2013 · Using a SELECT statement with a searched CASE expression. Within a SELECT statement, the searched CASE expression allows for values to be replaced in the result set based on comparison values. The following example displays the list price as a text comment based on the price range for a product.
7 Μαΐ 2017 · The simple way to achieve this goal is to add a CASE expression to your SELECT statement. In this article, we'll introduce you to the syntax, formats, and uses of the CASE expression. The CASE expression is a conditional expression: it evaluates data and returns a result.
The CASE statement is a control statement that lets you choose a list of SQL statements to execute based on the value of an expression. If a WHEN clause exists for the value of value-expression, the statement-list in the WHEN clause is executed.
In a simple CASE expression, Oracle Database searches for the first WHEN... THEN pair for which expr is equal to comparison_expr and returns return_expr. If none of the WHEN... THEN pairs meet this condition, and an ELSE clause exists, then Oracle returns else_expr. Otherwise, Oracle returns null.
The SQL CASE Expression. The CASE expression goes through conditions and returns a value when the first condition is met (like an if-then-else statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause.
Oracle CASE expression allows you to add if-else logic to SQL statements without having to call a procedure. The CASE expression evaluates a list of conditions and returns one of the multiple possible results. You can use a CASE expression in any statement or clause that accepts a valid expression.