I run a monthly query for data and am tired of the query taking 4 hours cuz i have to use the new raw data I get each month. I have been just running an update query to get both primary keys in the two tables the same length. one table has over 10 million subscribers thus the reason it takes 4 hours to run the update query. I am trying to find a faster way rather than doing this update every single month. Here is the information.
I have two tables with multiple columns and the primary key is the same but not the same length. 1 is only 8000 rows and the other 10.7 million. I am trying to take the 8000 and compare it to the 10.7 million and get all the data from the 10.7 million based on the primary key in the 8000 row table. The key looks like this:
table1 table2
CustNbr1 CustNbr2
00800900 0800900
00810900 0810900
00811900 0811900
00912480 3912480
I have tried to do a join query and the query looks like this and it comes up with no results every time.
select right([custnbr1],6) as expr1, right([custnbr2],6) as expr2, table2.subid, table2.ind from table1 inner join table2 on table1.custnbr1=table2.custnbr2;
Now remember I typed this by looking at my work laptop and just manually typing so I can't copy and paste and if I missed some () or [] I apologize. The SQL is right in my work laptop. I just can't go to sites on my work laptop like this. They are not allowed.