leezac
asked on
Is NOT Null Oracle PLSQL
I need to show all the values where DVSN_NM is not null. (Null) shows in the field. I have tried IS NOT NULL and > 0 and < > 0 and nothing seems to work. Please advise. Any ideas appreciated. The column is Characters.
LEFT JOIN(
SELECT EMP_ID, SSN_ID, DVSN_NM
FROM dbo.V_PAT_PART
WHERE row_exp_d=TO_DATE('01/01/9 999','MM/D D/YYYY')
AND PLAN_ID IN ('1287')
AND DVSN_NM IS NOT NULL
) C ON A.EMP_ID=C.EMP_ID AND A.SSN_ID=C.SSN_ID
LEFT JOIN(
SELECT EMP_ID, SSN_ID, DVSN_NM
FROM dbo.V_PAT_PART
WHERE row_exp_d=TO_DATE('01/01/9
AND PLAN_ID IN ('1287')
AND DVSN_NM IS NOT NULL
) C ON A.EMP_ID=C.EMP_ID AND A.SSN_ID=C.SSN_ID
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And this is simply an Oracle SQL question, not a PL\SQL question.
ASKER
Double quotes show
when I ran SELECT EMP_ID, SSN_ID, '"' || DVSN_NM || '"'
when I ran SELECT EMP_ID, SSN_ID, '"' || DVSN_NM || '"'
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect. Where do I need to post to get help with Oracle SQL in Experts-Exchange. I have more questions I need help with. The AND trim(DVSN_NM) IS NOT NULL
worked great.
worked great.
The Oracle Topic Area is probably best.
If your question is related to this, I can probably answer it here.
If your question is related to this, I can probably answer it here.
ASKER
Quick question please. How do I create a column in sql to show a column not in table where I show data (this example would be if DVSN_NM = ABC then "Iceland". I would have 31 DVSN_NM's.
SELECT PLAN_N, DVSN_NM,
SUM(Case when BALANCE>0 THEN Balance Else 0 end) as "Assets", -- Assets
SUM(Case when BALANCE>0 THEN 1 Else 0 end) as "# Parts w/ Bal" -- Assets
FROM(
SELECT A.PLAN_ID, DVSN_NM, A.AS_OF_D
FROM dbo.V_BAL_MO A
SELECT PLAN_N, DVSN_NM,
SUM(Case when BALANCE>0 THEN Balance Else 0 end) as "Assets", -- Assets
SUM(Case when BALANCE>0 THEN 1 Else 0 end) as "# Parts w/ Bal" -- Assets
FROM(
SELECT A.PLAN_ID, DVSN_NM, A.AS_OF_D
FROM dbo.V_BAL_MO A
I don't see how that is related to this question. That should be a asked as a new question.
When doing so, please provide sample data and expected results. I don't understand what you are trying to do.
When doing so, please provide sample data and expected results. I don't understand what you are trying to do.
ASKER
Thank you!
Open in new window