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_i...
∙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_...
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; ...
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] ) ...
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; ...
decode 在OraclePLSQL中, decode 具有和 IFTHENELSE 一样的功能。 decode 函数语法如下: decode expression , search , result , search , result.
Using Oracle DECODE function with GROUP BY clause# See the followingproductstable: The following statement illustrates how to use theDECODE()function in theGROUP BYclause. It returns the number of products whose list prices are higher than, equal to, and less than the average list price. ...