select * from xxx where `field1`= `field2`

select * from xxx where `field2`!= `field3`