Showing results for sql nullif example
Search instead for sql null if example
🌐
W3Schools
w3schools.com › sql › func_sqlserver_nullif.asp
SQL Server NULLIF() Function
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Bootcamp SQL Certificate SQL Training ... The NULLIF() function returns NULL if two expressions are equal, otherwise it returns the first expression.
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › t-sql › language-elements › nullif-transact-sql
NULLIF (Transact-SQL) - SQL Server | Microsoft Learn
Copy CREATE TABLE budgets ( dept TINYINT, current_year DECIMAL(10,2), previous_year DECIMAL(10,2) ); INSERT INTO budgets VALUES(1, 100000, 150000); INSERT INTO budgets VALUES(2, NULL, 300000); INSERT INTO budgets VALUES(3, 0, 100000); INSERT INTO budgets VALUES(4, NULL, 150000); INSERT INTO budgets VALUES(5, 300000, 300000); SELECT dept, NULLIF(current_year, previous_year) AS LastBudget FROM budgets; Here's the result set. dept LastBudget ---- ----------- 1 100000.00 2 null 3 0.00 4 null 5 null · CASE (Transact-SQL) decimal and numeric (Transact-SQL) System Functions (Transact-SQL)
🌐
SQL Server Tutorial
sqlservertutorial.net › home › sql server basics › sql server nullif
SQL Server NULLIF
July 10, 2020 - The following example uses the NULLIF expression. It returns NULL because the first character string is equal to the second one: SELECT NULLIF('Hello', 'Hello') result; Code language: SQL (Structured Query Language) (sql)
🌐
W3Schools
w3schools.com › sql › func_mysql_nullif.asp
MySQL NULLIF() Function
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Bootcamp SQL Certificate SQL Training ... The NULLIF() function compares two expressions and returns NULL if they are equal.
🌐
TechOnTheNet
techonthenet.com › sql_server › functions › nullif.php
SQL Server: NULLIF Function
In SQL Server (Transact-SQL), the NULLIF function compares expression1 and expression2. If expression1 and expression2 are equal, the NULLIF function returns NULL.
🌐
GeeksforGeeks
geeksforgeeks.org › sql › nullif-function-in-sql-server
NULLIF() Function in SQL Server - GeeksforGeeks
July 23, 2025 - NULLIF() function in SQL Server is used to check if the two specified expressions are equal or not. If two arguments passed to a function are equal, the NULLIF() function returns Null to us. NULLIF() function operates like a Like a CASE Statement.
🌐
Oracle
docs.oracle.com › en › database › oracle › › › › › › oracle-database › 19 › sqlrf › NULLIF.html
SQL Language Reference
July 15, 2025 - Appendix C in Oracle Database Globalization Support Guide for the collation determination rules, which define the collation NULLIF uses to compare characters from expr1 with characters from expr2, and for the collation derivation rules, which define the collation assigned to the return value of this function when it is a character value ... The following example selects those employees from the sample schema hr who have changed jobs since they were hired, as indicated by a job_id in the job_history table different from the current job_id in the employees table:
🌐
DotFactory
dofactory.com › sql › nullif
SQL NULLIF Function
SELECT NULLIF('SQL', 'NoSQL') AS NotEqual, NULLIF('SQL', 'SQL') AS Equal Try it live
🌐
Hightouch
hightouch.com › sql-dictionary › sql-nullif
SQL NULLIF - Syntax, Use Cases, and Examples | Hightouch
December 29, 2023 - This result includes product names, but it replaces 'Discontinued' with NULL using the NULLIF function. Replacing specific values with NULL in query results. Suppressing or hiding data based on specific conditions. Handling equality as a distinct case. The SQL NULLIF function is a standard SQL feature and is available in most relational database management systems (RDBMS) that support SQL.
Find elsewhere
🌐
EDUCBA
educba.com › home › data science › data science tutorials › sql tutorial › sql nullif()
SQL NULLIF() | A Quick Glance to SQL NULLIF() with Examples
March 10, 2023 - SELECT salesperson, NULLIF(sales_target,sales_current) AS 'target to be achieved' FROM sales; In this example, we have used NULLIF to return a null value if the salesperson has completed his or her targets and return sales_target for the ones ...
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
SQL Tutorial
sqltutorial.org › home › sql nullif function
SQL NULLIF Function
February 8, 2025 - The NULLIF function is equivalent to the following searched CASE expression: CASE WHEN value1 = value1 THEN NULL ELSE value1 ENDCode language: SQL (Structured Query Language) (sql) The following example uses the NULLIF function with two arguments are 100:
🌐
Database Star
databasestar.com › sql-nullif
SQL NULLIF Function Explained with Examples | Database Star: Home
June 18, 2015 - This function can also be expressed as an IF statement (using general syntax, not SQL). 1if (expr1 = expr2) then 2 return null; 3else 4 return expr1; 5end if; The NULLIF function checks two values and returns either the first value or NULL.
🌐
Snowflake Documentation
docs.snowflake.com › en › sql-reference › functions › nullif
NULLIF | Snowflake Documentation
SELECT a, b, NULLIF(a,b) FROM i; --------+--------+-------------+ a | b | nullif(a,b) | --------+--------+-------------+ 0 | 0 | [NULL] | 0 | 1 | 0 | 0 | [NULL] | 0 | 1 | 0 | 1 | 1 | 1 | [NULL] | 1 | [NULL] | 1 | [NULL] | 0 | [NULL] | [NULL] | 1 | [NULL] | [NULL] | [NULL] | [NULL] | --------+--------+-------------+ Copy · Snowflake Python APIs · Snowflake REST APIs · Snowflake CLI · See all interfaces · On this page · Syntax · Arguments · Returns · Collation details · Examples ·
🌐
Javatpoint
javatpoint.com › sql-server-nullif
SQL Server NULLIF - javatpoint
SQL Server NULLIF with sql server, install visual studio, install sql server, architecture, management studio, data types, db operations, login database, create database, select database, drop database, create table, delete tabel, update table, min function, max function, sum function, sql ...
🌐
Neon
neon.com › postgresql › postgresql-tutorial › postgresql-nullif
PostgreSQL NULLIF function
The following statements illustrate how to use the NULLIF() function: ... It returns null because the two arguments are equal. The following example returns the first argument because the two arguments are not equal:
🌐
PopSQL
popsql.com › learn-sql › postgresql › how-to-use-nullif-in-postgresql
PostgreSQL: nullif() Function Usage - PopSQL
Here's an example below: select name, platform, nullif(platform,'Did not specify') as platform_mod from users; name | platform | platform_mod -----------+-----------------+------------ Steve | Mac | Mac Bill | Windows | Windows Linus | Linux ...
🌐
Modern SQL
modern-sql.com › caniuse › nullif
NULLIF(…, …) | SQL
SQL nullif returns the value of ... the null value. ... The example returns the value of int_expression unless it contains the the value zero (0)—then it returns the SQL null value....
🌐
SQLite Tutorial
sqlitetutorial.net › home › sqlite functions › sqlite nullif
When and How to Use the SQLite NULLIF Function
April 11, 2020 - INSERT INTO products(name,price,discount) VALUES('Apple iPhone', 700, 0), ('Samsung Galaxy',600,10), ('Google Nexus',399,20);Code language: SQL (Structured Query Language) (sql) Third, to count the number of products that have discount, we use the NULLIF function as follows:
🌐
Medium
medium.com › @etimfonime › can-you-use-nullif-for-multiple-criteria-in-sql-58ab1ec801db
Can You Use NULLIF() Function for Multiple Criteria in SQL? | by Ime Eti-mfon | Medium
July 11, 2024 - SELECT NULLIF(NULLIF(NULLIF(column1, 'criteria1'), 'criteria2'), 'criteria3') AS result FROM table; In this example, column1 is checked against criteria1, criteria2, and criteria3 in sequence.