Re: trouble with exclusionary SQL query
Posted in 1998
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)