Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

NULL safe equality operator


  • From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
  • To: Hackers <pgsql-hackers(at)postgresql(dot)org>
  • Subject: NULL safe equality operator
  • Date: Fri, 25 Nov 2005 10:17:56 +0800
  • Message-id: <43867454(dot)6090105(at)familyhealth(dot)com(dot)au>

Hi guys,

Does anyone know how I'd go about implementing the following MySQL operator in PostgreSQL?

---

NULL-safe equal. This operator performs an equality comparison like the = operator, but returns 1 rather than NULL if both operands are NULL, and 0 rather than NULL if one operand isNULL.

mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
        -> 1, 1, 0
mysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;
        -> 1, NULL, NULL

---

Chris




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group