Αποτελέσματα Αναζήτησης
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, 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.
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.
15 Μαρ 2021 · You can use a SCALAR SUBQUERY - a query that returns zero or one rows with exactly one column. So this will work: 1* select case when dummy = 'X' then (select count(*) from all_users) else (select count(*) from dual) end cnt from dual ops$tkyte%ORA10GR2> / CNT ----- 46
26 Ιαν 2018 · In PL/SQL, there are two flavors. First, the CASE statement evaluates the contents of a variable and returns a value (implemented as a function). I refer to this version of the CASE statement as Format 1; Oracle calls it a Simple CASE statement.
19 Απρ 2019 · I am using Sql Developer 19.1.0.094. I have a case statement that is causing trouble for the formatter and code outline. select case when "a" < "b" then "b" else "a" end from dual; --Here, "a" is a static value and "b" is a case statement. for example, select case when 2 < case when 1=1 then 1 else 0 end. then case when 1=1 then 1 else 0 end.
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