mysql 中case和when
时间: 2023-09-07 20:17:04 浏览: 101
在MySQL中,CASE和WHEN语句用于计算条件列表并返回多个可能结果表达式之一。CASE具有两种格式:简单CASE函数将某个表达式与一组简单表达式进行比较以确定结果,而CASE搜索函数计算一组布尔表达式并返回第一个为真的结果表达式。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [MySQL 的CASE WHEN 语句使用说明](https://download.csdn.net/download/weixin_38751512/13693444)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [MySQL排序中使用CASE WHEN的方法示例](https://download.csdn.net/download/weixin_38705530/13702130)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [MySQL 中的数据类型介绍](https://download.csdn.net/download/qq_37647812/88226842)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文