我有一个简单的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
答案 0 :(得分: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))