PL/SQL (MOSC)

MOSC Banner

Encountering the NULL factor

edited Oct 28, 2009 10:53PM in PL/SQL (MOSC) 8 commentsAnswered ✓
 Hi,
Have a look at this select statement. 
*
SELECT STATE_DESC "SUIT"
FROM CBL_CONSUMR_NAME, CBL_ACNT_STATUS WHERE 
CONSUMR_ACNT_CAT = STATE_CODE;
*
Table CBL_ACNT_STATUS has two columns viz;
STATE_CODE and STATE_DESC.  It contains nine rows.  STATE_CODE contains values from 1 to 9 and STATE_DESC contains the description of these codes.
In CBL_CONSUMR_NAME table there is a column CONSUMR_ACNT_CAT which contains the same values like STATE_CODE column of table CBL_ACNT_STATUS.  The idea is to join these two columns and display the STATE_DESC. However, CONSUMR_ACNT_CAT can also contain NULL while STATE_CODE does not contain any NULL value.  Due to this factor, when I run this SELECT statement I do not get any output owing to this NULL factor despite the fact that CBL_CONSUMR_NAME actually contains one row.  How do I modify the select statement to get the output? 

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center