SQL Server Null Function and Comment. Session 28

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • Null Functions
    ISNULL ()
    ISNULL () function is used to replace NULL values.
    Syntax:
    SELECT column(s) FROM table_name
    WHERE ISNULL(column_name);
    NULLIF ()
    The NULLIF function takes two arguments. If the two arguments are equal, then NULL is returned. Otherwise, the first argument is returned.
    Syntax:
    SELECT column(s), NULLIF(expression1, expression2)
    FROM table_name;
    SELECT col1,col2, IFNULL(col3, value_to_be_replaced) FROM tableName;
    Comments
    • Single line comment
    • Multiline comment.

Комментарии •