SQL operators and integer division
Read the captured SQL operator overloads in Haybarn, compare operand types, and see how integer division differs from floating point division.
Choose a function
Operator symbols can have different behavior for different operand types. Check the matching overload and use explicit casts when the intended types are unclear.
//Divide integer operands and discard the fraction./Divide integer inputs with a floating point result.%Compute a remainder.||Concatenate compatible values.
These pages list operators present in the captured function catalog. SQL grammar constructs such as AND, OR, and IS NULL are not all represented as catalog functions.
Divide integers without a fractional result
Use the // operator for integer division. With integer operands, the fractional part is discarded rather than returned as a decimal.
For integer operands, truncation is toward zero. A NULL operand yields NULL.
Guide example · Run to view results.
| quotient | negative_quotient | missing |
|---|---|---|
3 | -3 | NULL |
Watch for: The / operator performs floating point division on integer inputs. Choose // only when discarding the remainder is intended.
All operators functions
34 functions in Haybarn WASM 2.0.0-rc12. Browse the filtered catalog →
-->>!Factorial of x. Computes the product of the current integer and all integers below it
!=Returns whether left is not equal to right.
!~~!~~*@Absolute value
@>Returns true if all elements of list2 are in list1. NULLs are ignored.
***Computes x to the power of y
///Use the // operator for integer division. With integer operands, the fractional part is discarded rather than returned as a decimal.
&Bitwise AND
&&Returns true if the geometries bounding boxes intersect
%^Computes x to the power of y
^@Returns
trueifstringbegins withsearch_string.+<Returns whether left is less than right.
<->Calculates the Euclidean distance between two points with coordinates given in two inputs lists of equal length.
<@Returns true if all elements of list2 are in list1. NULLs are ignored.
<<Bitwise shift left
<=Returns whether left is less than or equal to right.
<=>Computes the cosine distance between two same-sized lists.
=Returns whether left is equal to right.
>Returns whether left is greater than right.
>=Returns whether left is greater than or equal to right.
>>Bitwise shift right
|Bitwise OR
||Concatenates two strings, lists, or blobs. Any
NULLinput results inNULL. See alsoconcat(arg1, arg2, ...)andlist_concat(list1, list2, ...).~Bitwise NOT
~~~~*~~~