SELECT
CASE WHEN COLUMN1 = COLUMN2
THEN '1'
ELSE '0'
END
AS MyDesiredResult
FROM Table1
INNER JOIN Table2 ON Table1.PrimaryKey = Table2.ForeignKey
SELECT CASE WHEN REPLACE (Table1.ColName1,'.','') = Table2.ColName2
THEN 'Equal'
ELSE 'Not Equal'
END AS IsEqual
FROM Table1
INNER JOIN Table2 ON Table1.PrimaryKey = Table2.ForeignKey
SELECT field1, field2, IF(field1 = field2, 'Same', 'Different') AS Status
FROM table