Encountering the NULL factor
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?
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?
0