sql_or(X;Y)

Returns a boolean value indicating whether X or Y are true. This function has SQL-compatible null handling.

Syntax

sql_or(X;Y)

Input

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

Return Value

sql_or(X;Y) returns a boolean value of 1 if either X or Y are true and 0 if X and Y are both false.

The data type of the result is integer.

If X or Y is N/A (null), the result is also N/A.

Example

This example uses the sql_or(X;Y) function to return 1 if either colx or coly are true, which means containing the value 1. The function returns 0 if colx and coly are both false.

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

<table cols="colx,coly">
  1,0;
  0,1;
  0,0;
  1,1;
  ,1;
  1,;
  0,;
  ,0;
  ,;
</table>
<willbe name="sqlor" label="SQL Null" value="sql_or(colx;coly)"/>
<willbe name="and" label="Null" value="colx|coly"/>