Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

ISNULL

Example

Return the specified value if the expression evaluates to NULL; otherwise, return the expression itself.

SELECT ISNULL(NULL, ‘W3Schools.com’);

Definition and Usage

The ISNULL() function substitutes a specified value if the expression is NULL; otherwise, it returns the expression itself.

Syntax

ISNULL(expressionvalue)

Parameter Values

Parameter

Description

expression

Mandatory. The expression that is checked to determine if it is NULL.

value

Mandatory. The value that is returned if the expression evaluates to NULL.

Technical Details

Works in:

 SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse

More Examples

Example

Return the specified value if the expression is NULL; otherwise, return the expression itself.

SELECT ISNULL(‘Hello’‘W3Schools.com’);

Example

Return the specified value if the expression is NULL; otherwise, return the expression itself.

SELECT ISNULL(NULL, 500);