[英]Error of SQL query on IBM netezza SQL database from Aginity workbench on Win7
I need to so a sql query on IBM netezza sql database from Aginity workbench on win7. 我需要从win7上的Aginity工作台在IBM netezza sql数据库上执行sql查询。
My query: 我的查询:
SELECT *
from table1 AS c ,
table2 AS b
where CAST(c.id as int) = b.id
in table1, id is character varying(20) and in table2, id is int. 在表1中,id是可变字符(20),在表2中,id是整数。
Table1:
id value1 value2
'985' 'casdqwdc' '654.3184' // they are all char
Table2:
id value1
985 694381 // id is int, value1 is int
I got error: 我收到错误消息:
ERROR [HY000] ERROR: pg_atoi: error in "id": can't parse "id"
Any help would be appreciated. 任何帮助,将不胜感激。
Somewhere in column ID in table1 there is a value that can't be converted to an integer. 在table1的列ID的某处,有一个值不能转换为整数。
Based on the error, you have probably used nzload or an external table to load a data file that has a header row with column labels without skipping that row, and you have 1 row with the value 'ID' in the column ID. 基于该错误,您可能已使用nzload或外部表加载了具有标题列且带有列标签的数据文件,而没有跳过该行,并且您有1行的列ID中的值为“ ID”。
TESTDB.ADMIN(ADMIN)=> select CAST('ID' as int);
ERROR: pg_atoi: error in "ID": can't parse "ID"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.