how to retrive non matchin records from oracle table?

Posted by Tdhivamca under Sql Server on 11/22/2010 | Points: 10 | Views : 1190 | Status : [Member] | Replies : 1
I m having below structured two tables

table1 name - trans_log
Trans_id,
Msisdn,
keyword,
event

table2 name - recon_log
Trans_id,
Msisdn,
keyword,
event

Trans_id and msisdn both having same value in both table but keyword and event having different values in both table for same records. that records i need to get . please help me how to get

-
Dhivakaran T



Responses

Posted by: T.saravanan on: 11/22/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Try the following query...

Get value from table trans_log

Select A.Trans_id, A.Msisdn, A.keyword, A.event  from trans_log  A,recon_log B

where A.Trans_id = B.Trans_id and A.Msisdn = B.Msisdn
-- and A.keyword not in (select distinct keyword from recon_log) // if you need use this condition
-- and A.event not in (select distinct event from recon_log) // if you need use this condition


Get value from table recon_log

Select B.Trans_id, B.Msisdn, B.keyword, B.event  from trans_log  A,recon_log B

where A.Trans_id = B.Trans_id and A.Msisdn = B.Msisdn
-- and B.keyword not in (select distinct keyword from trans_log) // if you need use this condition
-- and B.event not in (select distinct event from trans_log) // if you need use this condition


Cheers :)

Thanks,
T.Saravanan

Tdhivamca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response