mysql COALESCE
时间: 2023-08-25 19:13:43 浏览: 153
COALESCE函数在MySQL中用于返回参数列表中的第一个非空值。如果所有参数都为空,则返回NULL。其语法如下:COALESCE(val1, val2, ..., valN),其中val1、val2到valN表示可选的多个参数,函数会从左到右依次检查这些参数是否为空,然后返回第一个非空值。该函数在MySQL中也可以用来替代Oracle中的nvl函数,其使用方法类似,可以传入多个参数。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [如何在 MySQL 中使用 COALESCE 函数](https://blog.csdn.net/weixin_65846839/article/details/131322142)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *2* [Mysql coalesce()函数认识和用法](https://blog.csdn.net/suxun/article/details/46341725)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
- *3* [mysql coalesce](https://blog.csdn.net/u010365819/article/details/106556467)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文