Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sql --> query for empty column

Re: sql --> query for empty column

From: Peter Schneider <peter.schneider_at_okay.net>
Date: 1998/04/08
Message-ID: <352ac007.4039779@news.ipf.net>#1/1

On 7 Apr 1998 18:25:23 GMT, crd_at_cs.odu.edu (CRAIG READ DUNCAN) wrote:

>Hi,
>I need to query for an empty column in a certain record.
>The column in question definitly has some empty entries.
>I've tried <''>,<null>,<blanks>, and length(column). All
>come back with no hits.
>
>These records were created with sqlloader, if that has
>anything to do with it. The particlular column either
>had a text string (varchar2) or nothing. What's the trick?
>I suspect this is basic stuff; I'm new at this.
>
>Solaris 2.51
>Oracle 7.3.3
>
>I'd appreciate any help,
>crd

Hi Craig,

if you want to test for an empty column you need to use the syntax:

SELECT ...
  FROM ...
 WHERE column_name IS NULL;

The expression 'column_name = NULL' won't work, because NULL never is equal to something else, not even to another NULL.

HTH,
Peter

-- 
Peter Schneider
peter.schneider_at_okay.net
Received on Wed Apr 08 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US