- 论坛徽章:
- 0
|
紧急求助400的sql语法
原帖由 "myyzq" 发表:
具体点好马??
我不知道这个函数怎么用啊
IFNULL
The IFNULL function returns the value of the first non-null expression.
The IFNULL function is identical to the COALESCE scalar function with two
arguments. For more information, see “COALESCE” on page 193.
Example
v When selecting the employee number (EMPNO) and salary (SALARY) from all
the rows in the EMPLOYEE table, if the salary is missing (that is, null), then
return a value of zero.
SELECT EMPNO, IFNULL(SALARY,0)
FROM EMPLOYEE
IFNULL ( expression , expression ) |
|