Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
插入失败。3800:THEN/ELSE 表达式中的数据类型不匹配。我在 SQL tera 数据中遇到了这个错误
您的最后一个case表达式有问题,两个 valies (then和else) 必须是相同的数据类型:
case
then
else
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用一些有效日期或空值替换。
n/a