Re: trouble with exclusionary SQL query
Posted in 1998
The 'is not null' did it.
Thank you for your help.
-
Wanda
---------------------- Forwarded by Wanda Beck/SYBASE on 01/26/98 08:40 AM
---------------------------
proberts@lynx.informix.com on 01/23/98 07:44:03 PM
Please respond to proberts@lynx.informix.com
To: informix-list@rmy.emory.edu
cc: (bcc: Wanda Beck/SYBASE)
Subject: Re: trouble with exclusionary SQL query
In article <6abhs7$iub@cssun.mathcs.emory.edu>, Wanda Beck
<wbeck@sybase.com> wrote:
>
>Hi, Everyone!
>
>I'm trying to formulate a query to select values from a column in one
table
>where the values do not appear in a column in a second table. I've tried
>several different ways of querying and I either get all the rows from the
>first table (even if they are in the second table) or no rows at all.
>
>TAB1.A is char(20) and TAB2.B is varchar(20). We're using ODS 7.23 on
>HP-UX.
>
>I've tried the following:
>
[...]
>
>select A from TAB1
>where A not in( select B from TAB2 where B is not NULL )
^^^^^^^^^^^^^^^^^^^Wanda: try adding "where B is not NULL" as above. I betcha that fixes it.
- Paul (not a spokesman)