Hi ,
I am having 2 Tables Product and Category. My requirement is I have to capture the records those are present in Product table and not found in Category table and Vice versa in a single job. The common key is product _id.
PRODUCT CATEGORY
*********** ***************
PROD ID CATG_ID CATG_ID CATG_NAME PROD ID
1 100 100 ABC 1
2 101 101 PQR 2
3 102 103 RTS 4
Now in Project reject file I have to get " 3 102 " and CATEGORY reject I have to get " 103 RTS 4" .
Can anyone please tell me how to resolve this?
Thanks and Regards
Siva
Creating the Reject files for Source and Refrence tables
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 31
- Joined: Wed Mar 17, 2004 3:33 am
Re: Creating the Reject files for Source and Refrence tables
Code: Select all
PRODUCT CATEGORY
*********** ***************
PROD ID CATG_ID CATG_ID CATG_NAME PROD ID
1 100 100 ABC 1
2 101 101 PQR 2
3 102 103 RTS 4
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Either a full outer join.....
OR
OR
Code: Select all
SELECT *
FROM
(
SELECT table1_columns, add_table2_Columns
UNION ALL
SELECT add_table1_columns, table2_Columns
)
GROUP BY
yourKeyField
HAVING count(*) <> 2