= (eq sign) operator

Returns true if expr1 equals expr2, or false otherwise.

Syntax

expr1 = expr2

Arguments

  • expr1: An expression of any comparable type.

  • expr2: An expression sharing a least common type with expr1.

Returns

A BOOLEAN.

This function is a synonym for == (eq eq sign) operator.

Use equal_null function to treat NULL as a comparable value.

Examples

> SELECT 2 = 2;
 true

> SELECT 1 = '1';
 true

> SELECT true = NULL;
 NULL

> SELECT equal_null(true, NULL);
 false

> SELECT NULL = NULL;
 NULL

> SELECT equal_null(NULL, NULL);
 true