我有一个变量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。