Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Data Value

Status
Not open for further replies.

kublait

MIS
Feb 4, 2004
36
US
Hi All,
I wrote a script that would evaluate the a particular data field from a view to that of another table. The script is as follow:

SELECT DISTINCT
SIEBEL.FMS_VALIDATION_VIEW.ACCOUNT_NUMBER,
'ADDRESS',
-- FMS VALIDATION VIEW VALUE
CASE
WHEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
THEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null')
END AS SIEBEL_VALUE,
-- CX CC PARSE DIA TABLE VALUE
CASE
WHEN NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
THEN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')
END AS DIA_VALUE
FROM SIEBEL.FMS_VALIDATION_VIEW,
SIEBEL.CX_CC_PARSE_DIA
WHERE SIEBEL.FMS_VALIDATION_VIEW.ACCOUNT_NUMBER = SIEBEL.CX_CC_PARSE_DIA.ACCOUNT_NUMBER
AND SIEBEL.FMS_VALIDATION_VIEW.WORKORDER_NUM = SIEBEL.CX_CC_PARSE_DIA.WORKORDER_NUM
AND NVL(SIEBEL.FMS_VALIDATION_VIEW.ADDRESS, 'Null') NOT IN NVL(SIEBEL.CX_CC_PARSE_DIA.ADDRESS, 'Null')


The problem that I'm encountering is that the results are being returned as:

ACCOUNT_NUMBER ADDRESS SIEBEL_VALUE DIA_VALUE
8255110110001478 ADDRESS 123 MAIN ST PO BOX 1
8255110110001478 ADDRESS PO BOX 1 123 MAIN ST

Creating a unique key would not help because I have to perform the same "unmatch" evaluation on all of the fields between the view and the table. Theoretically the street address and the po box is a match and should not be return in the values. I had though the NOT IN function would solve this problem, but it doesn't. I would appreciate any help. Thanks in advance.

Kublait
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top