Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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
Comment

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
Comment

compare fields sql

SELECT field1, field2, IF(field1 = field2, 'Same', 'Different') AS Status 
FROM table
Comment

PREVIOUS NEXT
Code Example
Sql :: sql except query 
Sql :: store date time in mysql 
Sql :: postgresql multiple insert with subquery 
Sql :: like in sql 
Sql :: Sql Text or Varchar 
Sql :: sql count * vs count 1 
Sql :: update view sql 
Sql :: ms sql select datetime as date 
Sql :: mysqldump 
Sql :: mysql create trigger 
Sql :: mysql create database 
Sql :: postgresql comandos basicos 
Sql :: sql example 
Sql :: recourse record format 
Sql :: create-toys-table-with-toy_name-column 
Sql :: online compiler for sql plus 
Sql :: install sql 
Sql :: sql truncate table referencing itself 
Sql :: sqlite show table headers 
Sql :: Oracle Function execution 
Sql :: MySQL Age Counter 
Sql :: create relationship with betwen two tables in postgersql 
Sql :: SQL Views for Complex Queries 
Sql :: qt qsql check if table exist 
Sql :: sqlite schema structure of a relational database 
Sql :: knex sqlite 
Sql :: BigQuery: join 2 tables but only choosing rows based on date column 
Sql :: oracle database table to check invalid login attempts 
Sql :: mysql streaming example 
Sql :: oracle list subpartitions 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =