Hi Gene,

You've already got your workarounds in place but for future reference this is 
where you can use NVL() in your SQL to avoid nulls that might arise from a 
left/right/outer join.

SELECT t1.column1, NVL(t2.column2,0) column2, t1.column3...

--

rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Gene 
Wirchenko
Sent: Thursday, April 16, 2015 12:49 PM
To: [email protected]
Subject: Re: Nulls

At 03:23 2015-04-16, Laurie Alvey <[email protected]> wrote:
>In my innocence, I wonder why you want to disallow NULLs? They are, 
>IMHO, the best way to hold unknown or irrelevant column values.

      They get ambiguous.  Take your example above.  Does a null mean unknown 
or irrelevant?  The two are different cases.  e.g. A employee's salary might be 
unknown, or the employee might not be salaried.

      You can always record explicitly that something is unknown if you want.

      Nulls poison expressions.  The moment you have the possibility of a null, 
you have to code handle nulls.  Yes, the tables may be less complex, but that 
complexity then has to be dealt with in the app code again and again and again.

      Due to an error in SQL, summing a column in a table where there are no 
matching rows gives a result of null.  It should give a result of 0, that being 
the identity element for addition.  Because of this one glitch, I have had to 
adjust results in several places in my system, replacing null with 0.

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/blupr10mb0451306667525bb87bfb3c9cd2...@blupr10mb0451.namprd10.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to