[SQL ERROR 800]Corresponding types must be compatible in CASE expression.
来源:互联网 发布:中兴商城下载软件 编辑:程序博客网 时间:2024/05/22 11:53
错误描述:
11:00:51 [SELECT - 0 row(s), 0.000 secs] [Error Code: -800, SQL State: IX000] Corresponding types must be compatible in CASE expression.
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]
IBM解释:
Cause
The data types of the THEN and ELSE part are different. For example the THEN part return a date value and the ELSE part return a date/time value.
Environment
Windows
Diagnosing the problem
Check your report for IF/THEN/ELSE expressions.
Resolving the problem
Verify your Impromptu report for IF/THEN/ELSE expressions.
Check the data type of the THEN part with the data type of the ELSE part. Both need to be return the same data type. If not you need to add an additional calculation or a function to transform the result into a result with the required data type.
Exapmle:
IF ( column <> 1 ) THEN ( date ) ELSE ( date + 001 00:00:00:000 )
The THEN part returns a date value (data type: date)
The ELSE part returns a date/time value (data type: date/time)
Modify the above expression into:
IF ( column <> 1 ) THEN ( date + 000 00:00:00:000 ) ELSE ( date + 001 00:00:00:000 )
The THEN part returns a date/time value.
The ELSE part returns a date/time value.
or
IF ( column <> 1 ) THEN ( date ) ELSE ( datetime-to-date ( date + 001 00:00:00:000 ) )
The THEN part returns a date value.
The ELSE part returns a date value.
http://www-01.ibm.com/support/docview.wss?uid=swg21425745
举例分析:
select unique case when month(statdate) <10 then 0||month(statdate) else ''||month(statdate) end statdate from disxxx
where statdate = '20130731' or statdate = '20121231';
select unique case when month(statdate) <10 then 0||month(statdate) else month(statdate) end statdate from disxxx
where statdate = '20130731' or statdate = '20121231'
0||month(statdate) 这个得到的 是一个字符串
month(statdate) 这个得到的是个 数字。
两个冲突!
- [SQL ERROR 800]Corresponding types must be compatible in CASE expression.
- java.sql.SQLException: ORA-01790: expression must have same datatype as corresponding expression
- expression must have same datatype as corresponding expression
- debug03:“case expressions must be constant expression”报错的破解
- Error处理:Java switch case 报错:case expressions must be constant expressions
- Using the CASE Expression in SQL Queries @ JDJ
- React Native报Super expression error must either be null or a function错误分析
- Uncaught (in promise) TypeError: Super expression must either be null or a function
- TypeError: view must be a callable or a list/tuple in the case of include()
- python django1.10解决view must be a callable list/tuple in case of include()
- TypeError: view must be a callable or a list/tuple in the case of include().
- TypeError: view must be a callable or a list/tuple in the case of include().解决办法
- TypeError: view must be a callable or a list/tuple in the case of include()
- TypeError: view must be a callable or a list/tuple in the case of include()
- E0137 expression must be a modifiable lvalue
- case expressions must be constant expressions
- case expressions must be constant expressions
- case expressions must be constant expressions
- Trap in Unix
- Sun T2000(Solaris 10)上安装MB-System的历程
- 获取Android控件的宽和高
- 国外程序员推荐的免费编程书籍资源
- 概率(5)---涂色问题
- [SQL ERROR 800]Corresponding types must be compatible in CASE expression.
- 合作版机房收费系统—文档
- C#初学者——终于奋战一个月找到了自己心意的工作
- 子数组的最大和[算法]HDU1003/HDU1231/找到这些数使得它满足:它是左边的最大值且是右边的最小值
- 自己设计的一个物理架构图
- Java解数独--世界最难数独
- javaIO输入输出流
- 网狐 很抱歉,游戏房间连接失败,请稍候再试或留意网站公告
- ※数据结构※→☆线性表结构(list)☆============链表 顺序存储结构(list sequence)(一)