解决Type mismatch of columns to JOIN by: user_id: Int64 at left, b.user_id: UInt64 at right.

一、问题描述

其实是极其简单的一个问题,还是记录下,就是join时on的字段类型不一致而导致join不成功,然后就报错Type mismatch of columns to JOIN by: user_id: Int64 at left, b.user_id: UInt64 at right. Can't get supertype: There is no supertype for types Int64, UInt64 because some of them are signed integers and some are unsigned integers, but there is no signed integer type

SELECT a.user_id, a.signature, a.fb_gender, a.emotional, a.region, b.nickname
FROM a
INNER JOIN b
ON a.user_id = b.user_id;

二、解决方案

因为左表的类型为Int64,右表的类型为UInt64,可以对前者使用CAST类型转换统一下即可。

SELECT a.user_id, a.signature, a.fb_gender, a.emotional, a.region, b.nickname
FROM insitude_rs.party_ods_user_profile as a
INNER JOIN insitude_rs.party_gdm_user_info as b
ON CAST(a.user_id AS UInt64) = b.user_id;

猜你喜欢

转载自blog.csdn.net/qq_35812205/article/details/129738198
今日推荐