小白教程
所有教程
关于
Search
172.69.6.106
172.69.6.106
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Mysql func ifnull”的源代码
本页内容
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:IFNULL(v1,v2)}}[[Category:mysql functions|1]] = MySQL IFNULL() 函数 = [[mysql functions|MySQL 函数]] IFNULL() 函数用于判断第一个表达式是否为 NULL,如果为 NULL 则返回第二个参数的值,如果不为 NULL 则返回第一个参数的值。 IFNULL() 函数语法格式为: <sample title="" desc="" lang="sql" hererun="1"> IFNULL(expression, alt_value) </sample> 如果第一个参数的表达式 expression 为 NULL,则返回第二个参数的备用值。 '''参数说明:''' {| class="table table-striped table-hover" ! 参数 ! 描述 |- | expression | 必须,要测试的值 |- | alt_value | 必须,expression 表达式为 NULL 时返回的值 |} == 第一个参数为 NULL: <sample title="" desc="" lang="sql" hererun="1"> SELECT IFNULL(NULL, "XiaoBai.Wang"); </sample> 以上实例输出结果为: <sample title="" desc="" lang="sql" hererun="1"> XiaoBai.Wang </sample> 第一个参数不为 NULL: <sample title="" desc="" lang="sql" hererun="1"> SELECT IFNULL("Hello", "XiaoBai.Wang"); </sample> 以上实例输出结果为: <sample title="" desc="" lang="sql" hererun="1"> Hello </sample> [[mysql functions|MySQL 函数]]
返回至“
Mysql func ifnull
”。