Function Reference > Operators > Comparison operators

# Comparison operators

Use comparison operators to compare string or numeric strings, manipulate data, and return a TRUE (1) or FALSE (0) value.
The following table lists the transformation language comparison operators:
Operator
Meaning
=
Equal to.
>
Greater than.
<
Less than.
>=
Greater than or equal to.
<=
Less than or equal to.
<>
Not equal to.
!=
Not equal to.
^=
Not equal to.
Use the greater than (>) and less than (<) operators to compare numeric values or return a range of rows based on the sort order for a primary key in a particular field
When you use comparison operators in an expression, the operands must be the same datatype. For example, the expression 123.4 > ‘123’ is not valid because the expression compares a decimal with a string. The expressions 123.4 > 123 and ‘a’ != ‘b’ are valid because the operands are the same datatype.
If you compare a value to a null value, the result is NULL.
If a filter condition evaluates to NULL, Data Integration returns NULL.

## Comparing hierarchies

You can use the equal to (=) and not equal to (!=) operators to compare two arrays or two structs.

### Comparing arrays

Two arrays are equivalent if the following conditions are true:
• The array elements are the same data type.
• The arrays are the same size.
• The element at each index is the same.
For example, you have the following arrays:
A = [1, 2, 3]
B = [1, 2, 3]
You can make the following comparison:
A = B
Both arrays contain integers, the arrays are the same size, and the element at each index is the same such that A=B, A=B, and A=B. The return value is TRUE (1).

### Comparing structs

Two structs are equivalent if the following conditions are true for the corresponding struct elements:
• The elements are the same data type.
• The elements hold the same data.
Note: Two structs are equivalent even if the elements have different names.
For example, you have the following structs:
struct1 {
name:'Paul'
zip:10004
}

struct2 {
firstname:'Paul'
zip1:10004
}
You can make the following comparison:
struct1 = struct2
The corresponding elements are the same data type and hold the same data, so the return value is TRUE (1).