defaultis optional. If no matches are found, the decode will returndefault. Ifdefaultis omitted, then the decode statement will return null (if no matches are found). Applies To: Oracle 9i, Oracle 10g, Oracle 11g For example: You could use the decode function in an SQL statement as follo...
∙Oracle 9i, Oracle 10g, Oracle 11g 例如:You could use the decode function in an SQL statement as follows:select supplier_name,decode(supplier_id,1000,'IBM',10001,'Microsoft','1002','Hewlett Packard','Gateway') result from suppliers;上面的sql语句相当于下面的IF-THEN-ELSE :IF supplier_...
Oracle 9i, Oracle 10g, Oracle 11g 例如: You could use the decode function in an SQL statement as follows: select supplier_name,decode(supplier_id,1000,'IBM',10001,'Microsoft','1002','Hewlett Packard','Gateway') result from suppliers; 上面的sql语句相当于下面的IF-THEN-ELSE : IF supplier_i...
The DECODE function in Oracle is a versatile and powerful tool that allows users to perform conditional transformations on data within an SQL query. It is similar to the CASE statement, but it offers a more compact syntax, making it a popular choice for simplifying complex queries and improving...
Oracle 9i, Oracle 10g, Oracle 11g 例如: You could use the decode function in an SQL statement as follows: select supplier_name,decode(supplier_id,1000,'IBM',10001,'Microsoft','1002','Hewlett Packard','Gateway') result from suppliers; ...
In the following example, the OracleDECODE()function compares the first argument (1) with the second argument (1). Because they are equal, the function returns the third argument which is the string'One': It works like the followingifstatement ...
decode 在OraclePLSQL中, decode 具有和 IFTHENELSE 一样的功能。 decode 函数语法如下: decode expression , search , result , search , result.
InOracle/PLSQL,thedecodefunctionhasthefunctionalityofanIF-THEN-ELSEstatement. Thesyntaxforthedecodefunctionis: decode(expression,search,result[,search,result]...[,default]) expressionisthevaluetocompare. searchisthevaluethatiscomparedagainstexpression. resultisthevaluereturned,ifexpressionisequaltosearch. de...
应用于Oracle 9i, Oracle 10g, Oracle 11g。 例如: 复制 You could use the decode function in an SQL statement as follows:select supplier_name,decode(supplier_id,1000,'IBM',10001,'Microsoft','1002','Hewlett Packard','Gateway') result from suppliers; ...
The decode function can be used in SQL for and IF-THEN-ELSE construction. It's an alternative for the CASE statement which was introduced in Oracle 8. Syntax: decode( expression , compare_value, return_value, [,compare, return_value] ... [,default_return_value] ) ...