If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How to get rows that r not common in two tables?

hi ,
I have two tables report and report_old having same table structure.Data in both is different.Some rows are common in both while others are different.
MSISDN NUMBER,
EXPIRY_DATE DATE,
VAL_BKT VARCHAR2(4000),
ACCT_BALANCE NUMBER,
BAL_BKT VARCHAR2(4000)
I want to get to get all the msisdn in report table that are not in the report_old table.I use below query for that but its taking long time execute.
create table report_ins
as
(select *From report
where msisdn not in (select msisdn from report_old));
Both the table contain more than 360000 rows of data .
Plz help.

try with exists operator

try with this query .. it will reduce the access time but not sure how much.. but it is good query compared to older one.
create table report_ins
as
(select *From report a
where not exists (select b.msisdn from report_old b where a.msisdn=b.msisdn));

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.