无法将char转换为整数

时间:2018-11-14 19:36:38

标签: casting derby

我有一个变量FACTOR,观察到的是“ FAC_11”,我正在尝试以下操作:

select distinct factor from sp500_2003 
       where CAST(CAST(substr(factor,5,1) AS CHAR)AS INT)  = 1;

我收到错误消息:

Invalid character string format for type INTEGER.

尽管

select distinct factor from sp500_2003 where CAST(substr(factor,5,1) AS CHAR)  = '1';

文档说我们应该能够将CHAR强制转换为INT。

0 个答案:

没有答案