Re: Eliminating Nulls

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 6 Jul 2005 10:04:36 -0700
Message-ID: <1120669476.733420.234500_at_f14g2000cwb.googlegroups.com>


It would appear the problem I was thinking about in referencing nulls in SQL Server has to do with the isnull function and outer joins.

This would not be an issue for those who use a different RDBMS. For those of you who use SQL Server this may be of interest. Using the provided sample databases:

select a.au_id, a.au_lname, title_id = isnull(t.title_id, '-') from authors a, titleauthor t
where a.au_id *= t.au_id
and a.au_lname like 'S%'
and isnull(t.title_id, '-') = '-'

The results will be three rows will a title_id of '-' however a review of the data will show that author Straight has a title_id value.

The example can be found in Transact-SQL Programming by Kline, Gould, and Zanevsky published by O'Reilly. Again it is not an issue for Oracle, DB2, etc...

  • Mark D Powell --
Received on Wed Jul 06 2005 - 19:04:36 CEST

Original text of this message