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 :: how to limited number of rows in db2 select * from imglib FETCH FIRST 20 ROWS ONLY 
Sql :: oracle boolean to varchar 
Sql :: python sqlalchemy orm to select null values 
Sql :: postgres insert into table 
Sql :: sql server fn_dblog 
Sql :: Unable to locate package libmysql-java 
Sql :: mssql coalesce 
Sql :: tsql generate rows 
Sql :: sql field equals multiple values 
Sql :: drop domain postgresql 
Sql :: SQL SUM() Function 
Sql :: sql with as 
Sql :: convert sql server guid to varbinary 
Sql :: oracle synonym procedure 
Sql :: sql update by id 
Sql :: sql join on wildcard 
Sql :: sqlalchemy default value for column 
Sql :: sql create database statement 
Sql :: REMOVE DATE FROM DATE TIME SQL SERVER 
Sql :: insert ip address in mysql 
Sql :: oracle list partitions 
Sql :: sql commands 
Sql :: postgres disable foreign keys 
Sql :: alter rename command in mysql 
Sql :: sqlstate[hy000] [2006] mysql server has gone away laravel 
Sql :: case statement in sql 
Sql :: xampp reset mysql 
Sql :: auto increment psql not primary key 
Sql :: ranking functions in sql 
Sql :: How to solve "Error: MySQL shutdown unexpectedly"? 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =