SQL compare two columns for same value

后端 未结 2 1613
予麋鹿
予麋鹿 2021-01-29 05:25

With SQL Server 2012, I have two columns that I would like to compare. Both are on the same table, so no joins are needed.

Basically I need to compare two columns, for e

2条回答
  •  悲哀的现实
    2021-01-29 06:03

    Something like SELECT .... , CASE WHEN scan1 = scan2 THEN 1 ELSE 0 END AS is_equal FROM table1 should do the job.

提交回复
热议问题