Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

How to compare two columns in SQL server

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
Source by sqlerrors.com #
 
PREVIOUS NEXT
Tagged: #How #compare #columns #SQL #server
ADD COMMENT
Topic
Name
4+6 =