Tag: SQL Server SQL data MySQL
This article introduces the ISNULL functions in SQL Server, as well as the ifnull functions in MySQL, describes the specific usage and differences between the two, interested friends can study oh.
First look at the IsNull function of SQL serve:
ISNULL (Check_expression,replacement_value)
1. The data types of check_expression and Replacement_value must be identical.
2. If check_expression is null, Replacement_value is returned.
3. If check_expression is null, Check_expression is returned.
Then look at MySQL's ifnull function:
Ifnull (EXPR1,EXPR2)
Returns EXPR2 if EXPR1 is not Null,ifnull () returns EXPR1.
Below is a look at the specific usage of isnull and nullif in SQL Server.
ISNULL in SQL Server differs from ISNULL in ASP, there are two parameters in SQL Server.
One, ISNULL syntax:
ISNULL (Check_expression, Replacement_value)
1,check_expression and Replacement_value data types must be consistent
2, if Check_expression is NULL, returns Replacement_value
3, if Check_expression is not NULL, returns check_expression
Second, Nullif is used to check two expressions.
Grammar:
Nullif (expression, expression)
Description
If two expression is equal, returns NULL, which is the data type of the first expression.
If two expression is not equal, the first Expressio is returned.
IsNull functions in SQL Server and the use of ifnull functions in MySQL