首页 > 其他分享 >CASE types integer and text cannot be matched

CASE types integer and text cannot be matched

时间:2022-11-06 16:22:51浏览次数:102  
标签:CASE case text when cannot 子句 types

报以上错误可能的错误场景之一是:

当你在写case when 语句的时候,when不同的条件的时候then里面想拼接内容,使用了concat()函数

image-20220923110250603

注:请认真阅读,出现这种错误说明你对case when 细节掌握的不够好

  1. ELSE 可以不写,默认返回null
  2. end 不可以忘记
  3. 当一个case子句中有多个判断逻辑时、字段类型需要一致,这个旺旺会被忽略.
  4. 当一个case子句中有多个判断逻辑时、第一个为真的结果会被输出
  5. 每一个case子句只输出一个结果

详细case when 用法请点击

标签:CASE,case,text,when,cannot,子句,types
From: https://www.cnblogs.com/javaxubo/p/16862901.html

相关文章