We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


The <=> operator in Vertica — Vertica Forum

The <=> operator in Vertica

This blog post was authored by Jim Knicely.

The <=> operator performs an equality comparison like the = operator, but it returns true, instead of NULL, if both operands are NULL, and false, instead of NULL, if one operand is NULL.

Example:

dbadmin=> SELECT 1 = 2         "Returns FALSE",
dbadmin->        1 <=> 2       "Returns FALSE",
dbadmin->        1 <> NULL     "Returns NULL",
dbadmin->        1 <=> NULL    "Returns FALSE",
dbadmin->        NULL <=> NULL "Returns TRUE";
Returns FALSE | Returns FALSE | Returns NULL | Returns FALSE | Returns TRUE
---------------+---------------+--------------+---------------+--------------
f             | f             |              | f             | t
(1 row)

Have fun!

Sign In or Register to comment.