SQL 查询报如下错误
Msg 468, Level 16, State 9, Line 3
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AS" in the equal to operation.
解决方案:这是因为数据库的字符集不一致导致的,在条件后添加 COLLATE Chinese_PRC_CI_AS
如下:
SELECT oper.CODE,RIGHT( oper.[Name] ,2) ClassName
FROM CRC_MOM..TeamClass_CRC_Oper_1967064050 oper
left join SIT_UA_Srv..DynamicClass_Detail cd on cd.TeamCode=oper.TeamCode COLLATE Chinese_PRC_CI_AS