DB2 ifnull
时间: 2023-08-30 17:07:52 浏览: 313
DB2 SELECT语句高级用法
在DB2中,没有ifnull函数,但可以使用coalesce()函数来替代。例如,可以使用以下语句来获取sys_inputbatch表中id为#{id}的记录的batchNo字段的值,如果batchNo为null,则返回1:select coalesce(batchNo,1) from sys_inputbatch where id=#{id}。\[3\]
#### 引用[.reference_title]
- *1* *2* [DB2中的特殊处理](https://blog.csdn.net/Childe_Jin/article/details/122193860)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [mysql 与DB2 的区别](https://blog.csdn.net/u011306408/article/details/110825981)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文