compare field sql server code example
Example: compare field sql server
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 COLUMN1 = COLUMN2
THEN '1'
ELSE '0'
END
AS MyDesiredResult
FROM Table1
INNER JOIN Table2 ON Table1.PrimaryKey = Table2.ForeignKey