pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joseph Shraibman <jks@p1.selectacast.net>
Cc: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] selectecting not null varchars.
Date: Thu, 24 Feb 2000 17:23:46 -0500
Message-ID: <23137.951431026@sss.pgh.pa.us> (raw)
In-Reply-To: <38B58AAE.B28DD6CB@selectacast.net>
References: <38B58AAE.B28DD6CB@selectacast.net>

Joseph Shraibman <jks@p1.selectacast.net> writes:
> select * from directory where h != null AND length(h) > 0 ;

The correct, SQL92-approved spelling for this condition is

	WHERE h IS NOT NULL AND ...

We also accept the abbreviation "h NOTNULL", although that's not a
standard AFAIK.  And of course you could do "NOT(h IS NULL)".

Certain Microsoft products that have difficulty grasping the concept of
NULL allow you to write these conditions with "=" or "!=", but in fact
any ordinary comparison operator should yield NULL out if either input
is NULL, so Microsoft is violating the letter and spirit of the spec by
accepting that.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <23137.951431026@sss.pgh.pa.us>
Permalink:  ../23137.951431026@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23137.951431026@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jks@p1.selectacast.net
  Subject: Re: [INTERFACES] selectecting not null varchars.
  In-Reply-To: <23137.951431026@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox