Re: [INTERFACES] selectecting not null varchars.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph Shraibman <jks(at)p1(dot)selectacast(dot)net>
Cc: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] selectecting not null varchars.
Date: 2000-02-24 22:23:46
Message-ID: 23137.951431026@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Joseph Shraibman <jks(at)p1(dot)selectacast(dot)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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ed Loehr 2000-02-24 23:50:21 Re: [INTERFACES] selectecting not null varchars.
Previous Message Joseph Shraibman 2000-02-24 21:46:47 Re: [INTERFACES] selectecting not null varchars.