1

我有一个简单JOIN的问题,我遇到了SQL以下问题。该语句返回 1 条记录,但如果我注释掉第 5 行,它不会返回任何记录。有任何想法吗?

SELECT A.district__c, b.annual_conference__c
FROM   Contact_UpdateDistricts A
JOIN   Contact B on a.id = b.id
WHERE  A.error NOT LIKE '%success%'
and a.id = '003Z000000C80tUIAR'
and A.district__c <> b.annual_conference__c
4

1 回答 1

1

我最终选择了决议的最后一个条款:

SELECT A.district__c, b.annual_conference__c 
FROM Contact_UpdateDistricts A 
JOIN Contact B on a.id = b.id 
WHERE A.error NOT LIKE '%success%' 
and CAST(A.district__c AS VARCHAR(18)) <> CAST(b.annual_conference__c AS VARCHAR(18))
于 2012-09-15T17:08:00.240 回答