sql server 2008 - Large amount of data transfer -
i have 2 tables , b. table has 36460090 records while table b has few lesser records table a. table b subset of table a. want transfer records table table b not in table b. there no primary key in both tables. table , table b both might contain duplicate records. how can carry out transfer? code below:
select a.* , b.id #temp tablea left join tableb b on a.id=b.id , a.var1=b.var1 ,a.var2=b.var2 .... , a.var12=b.var12
to select rows in not in b:
select a.* a.id in(select id except select id b); 2nd solution:
select a.* not exists(select 1 b b.id = a.id);
Comments
Post a Comment