sql_not(X)

Returns the logical negation of the argument X. This function has SQL-compatible null handling.

Syntax

sql_not(X)

Input

Argument Type Description
X
  • integer
  • big integer
A scalar expression or column expression that evaluates to 0 or 1

Return Value

sql_not(X) returns the negation of the value of X.

The data type of the result is integer.

If X is N/A (null), the row is not displayed.

Example

In this example, sql_not(X) returns the negation of the values in colx.

For null comparison, a column of results using the operator ~ (logical not) is provided for comparison. For more information, see ~ (logical not).

<table cols="colx">
  1;
  0;
  ;
</table>
<willbe name="sqlnot" label="SQL Null" value="sql_not(colx)"/>
<willbe name="and" label="Null" value="~colx"/>