Salesforce where clause of field1 = field2 of same object

You might wanted to bring your records like Select id from Account where Column1 = Column2, which is not possible in Salesforce.
For this you have to create a formula field as Text and then populate this field as TRUE if the column1 = column2 else populate the value as FALSE.
Finally you can write a query as:

select id from Account where formulafield = 'TRUE'