Αποτελέσματα Αναζήτησης
select case substr(status,1,1) -- you're only interested in the first character. when 'a' then 'Active'. when 'i' then 'Inactive'. when 't' then 'Terminated'. end as statustext. from stage.tst. However, there's a few worrying things about this schema.
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.
22 Ιουλ 2016 · You need to either o set the numformat to something you like o use a TO_CHAR on the number with a format that applies in your case. ops$tkyte@ORA817DEV.US.ORACLE.COM> select TO_NUMBER( TO_CHAR(9999999.6765722378,'999999999D9999999999')) from 2 dual; TO_NUMBER(TO_CHAR(9999999.6765722378,'999999999D9999999999')) ----- 9999999.68 ops$tkyte ...
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.
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?
2 Ιουν 2023 · The SQL CASE statement allows you to perform IF-THEN-ELSE functionality within an SQL statement. Learn more about this powerful statement in this article. This article applies to Oracle, SQL Server, MySQL, and PostgreSQL. Table of Contents. What Does the SQL CASE Statement Do? SQL CASE Statement Syntax. Parameters of the CASE Statement.
2 Ιαν 2015 · If I try to apply an ELSE statement to return the original value (by doing an inner select statement) it says ERROR at line 9: ORA-00932: inconsistent datatypes: expected CHAR got NUMBER