Yahoo Αναζήτηση Διαδυκτίου

Αποτελέσματα Αναζήτησης

  1. 1 Ιουν 2023 · Oracle DECODE Function with NULL Values. As I mentioned above, the Oracle DECODE function is an exception to other functions in how it handles NULL values. It treats a NULL expression and NULL search as equal (so NULL == NULL). So, this example will return 1: SELECT DECODE(NULL, NULL, 1, 0) FROM DUAL;

  2. 15 Μαρ 2012 · select decode(type_id, null, 'Unknown', type_id), name, count(*) from. (. select 'asdf' type_id, 'name1' name from dual union all. select 'asdf' type_id, 'name2' name from dual union all. select null type_id, 'name3' name from dual. ) test_table. group by type_id,name;

  3. SELECT DECODE (NULL, NULL, 'Equal', 'Not equal') FROM dual; Code language: SQL (Structured Query Language) (sql) In this tutorial, you have learned how to use the Oracle DECODE() function to add procedure if-then-else logic to SQL queries.

  4. 27 Δεκ 2023 · sql SELECT COUNT(DECODE(Order_Status, 'Delivered', 1)) AS Delivered_Orders, COUNT(DECODE(Order_Status, 'New', 1)) AS New_Orders FROM Orders; In this example, DECODE transforms 'Delivered' status to 1 and other statuses to NULL. Since COUNT ignores NULLs, this gives us the count of 'Delivered' orders.

  5. The Oracle/PLSQL DECODE function has the functionality of an IF-THEN-ELSE statement. Syntax. The syntax for the DECODE function in Oracle/PLSQL is: DECODE( expression , search , result [, search , result]... [, default] ) Parameters or Arguments. expression. The value to compare.

  6. 5 Ιουλ 2016 · SELECT least ( DECODE (:VAR1, 9999, NULL, :VAR1), DECODE (:VAR2,9999, NULL,:VAR2) ) FROM DUAL; VAR1 & VAR2 need to be NUMBERs (not varchar) the above SQL seems to work for all numbers except for the range of 100 to 149 (positive numbers ) For example : when VAR1 = 125 and VAR2 = 15.

  7. Purpose. DECODE compares expr to each search value one by one. If expr is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.

  1. Γίνεται επίσης αναζήτηση για