Αποτελέσματα Αναζήτησης
For example, you can use the CASE expression in statements such as SELECT, UPDATE, or DELETE, and in clauses like SELECT, WHERE, HAVING, and ORDDER BY. Oracle CASE expression has two formats: the simple CASE expression and the searched CASE expression. Both formats support an optional ELSE clause.
29 Δεκ 2014 · TO_DATE with proper format model should do the trick. Let's stick to a format model first. SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss'; Session altered. Now, let's use TO_DATE to explicitly convert the string literal to date.
For example, database triggers (code that is attached to tables discussed in Chapter 13, “Trig-gers,” and Chapter 14, “Mutating Tables and Compound Triggers”) on the server side and the logic behind an Oracle form on the client side can be written using PL/SQL.
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.
You can use CASE expressions in aggregate functions such as count. This returns columns for the pass and fail counts for each exam. It works because the CASE has no ELSE clause, meaning it returns NULL if the WHEN clause is not true.
This reference contains a complete description of the Structured Query Language (SQL) used to manage information in an Oracle Database. Oracle SQL is a superset of the American
The following example shows a simple CASE statement. Notice that you can use multiple statements after a WHEN clause, and that the expression in the WHEN clause can be a literal, variable, function call, or any other kind of expression.