我使用的数据在我的查询从同一服务器的另一个数据库
我得到了给定的错误
无法解决SQL_Latin1_General_CP1_CI_AS"one_answers";SQL_Latin1_General_CP850_BIN2"在等于运算中…本机错误:468。SQLSTATE: 42000。严重性16。MsgState 9。行39 .
我该如何修复它?
with
main AS (
SELECT a.LBrCode,a.PrdAcctId,b.SexCode,a.DateOpen,
case when (a.AcctStat=3 and a.DateClosed>'30-jun-2021') or a.AcctStat<>3 then 'live' else 'cl' end r1
FROM ac_mast a INNER JOIN prd_mat b ON a.CustNo=b.CustNo
WHERE rtrim(substring(a.PrdAcctId,1,8)) IN ('abc') AND a.AcctType=32
)
,
card_data AS (
SELECT substring(b.primary_a_c_number,1,3) LBrCode,
substring(b.primary_a_c_number,4,4)+replicate(' ',4)+replicate('0',8)+substring(b.primary_a_c_number,8,8)+replicate('0',8) PrdAcctId,
card_number,card_process_date,first_tran_date
FROM [hk_RDS2.0].dbo.cardx1 b
select a.LBrCode,a.PrdacctId,b.Card_number from main a inner join card_data b
on a.LBrCode=b.LBrCode and a.PrdAcctId=b.PrdAcctId
请帮
把这个从黑板上拿下来…
将查询的最后一部分改为:
select a.LBrCode,
a.PrdacctId,
b.Card_number
from main a
inner join card_data b on a.LBrCode = b.LBrCode collate database_default
and a.PrdAcctId = b.PrdAcctId