使用vertica 2个表关联查询:
SELECT
DISTINCT s.mac,
us.username,
us.uid
from A s INNER JOIN B us
ON s.userName = us.uid;
sql查询报错:
ERROR 2826: Could not convert "***" from column s.userName to a float8
找到错误原因:
A表结构查询sql:create table A(
mac varchar(50) ,
userName varchar(255)
);
B表结构create table B(
uid bigint ,
username varchar(80)
);
SELECT
DISTINCT s.mac,
us.username,
us.uid
from A s INNER JOIN B us
ON s.userName = us.uid;
sql查询报错:
ERROR 2826: Could not convert "***" from column s.userName to a float8
找到错误原因:
create table A(
mac varchar(50) ,
userName varchar(255)
);
create table B(
uid bigint ,
username varchar(80)
);
on之后的条件,2个字段类型不一致,修改成一致类型即可。
这个情况在mysql \ mariadb \ oracle
都会自动转换,vertica字段要求稍稍严格,错误比较搞笑,还查了好久,发现就是这个简单的问题导致的。
以后要多注意细节。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29000429/viewspace-1471030/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29000429/viewspace-1471030/