0

插入失败。3800:THEN/ELSE 表达式中的数据类型不匹配。我在 SQL tera 数据中遇到了这个错误

4

1 回答 1

0

您的最后一个case表达式有问题,两个 valies (thenelse) 必须是相同的数据类型:

case
  when ModifiedDate='NULL' 
  then 'n/a' -- this is char
  else cast (ModifiedDate as date format'yyyy-mm-dd') -- this is date
end as ModifiedDate

您应该考虑n/a用一些有效日期或空值替换。

于 2020-12-14T16:01:03.237 回答