Αποτελέσματα Αναζήτησης
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.
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.
Oracle Database 23c extended CASE expressions in PL/SQL to support dangling predicates in simple CASE expression. These work like regular simple CASE expressions - you have a single selector. Each WHEN clause may contain a comparison condition and the right-hand side of the formula.
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.
11 Νοε 2019 · I've run autotrace for each of the following queries: select case when my_date = to_date('99991231','YYYYMMDD') then 'A' else 'B' end from my_table; and select case when to_char(my_date,'YYYYMMDD') = '99991231' then 'A' else 'B' end from my_table; But it returns identical output: 7 recursive calls 52 db block gets 59 physical reads 139 redo size
7 Δεκ 2023 · Case statements can raise a case_not_found exception. This happens if they run without processing one of the clauses. i.e. none of the when conditions are true and there’s no else clause. There is no such exception for if-elsif blocks.
30 Ιουν 2016 · You could try the following to achieve the result. Your date format string is invalid and the column alias should be placed after the END clause of CASE expression. SQL> desc info Name Null?