1. Create a formula field
IF(Field1__c != Field2__c, 1, 0)
2. Write a SOQL as mentioned below
SELECT Id from Account WHERE FormulaField__c = 1
Cheers!!!
IF(Field1__c != Field2__c, 1, 0)
2. Write a SOQL as mentioned below
SELECT Id from Account WHERE FormulaField__c = 1
Cheers!!!