I have 300,000 records in table "businesses" and 50,000 in table "mint", both have a "phoneno" col which is cleansed (they are all in the same format so are viable to be my way of matching)
Im trying to check if they are in the businesses table before i insert them, so i made another column on the mint table and run the below query. the idea is to then insert all the null values into "businesses".
update mint t9
inner join businesses b
on b.Telephone = t9.phoneno
set t9.bid = b.businessID
The problem is the query just runs forever until it timesout and never gives me any results, even though i know there are some that should be matched. Am i doing something obviously wrong? -------------------------------------- edit-------------------------------
The columns in the tables that are relevant are :
---businesses-- BusinessID | Telephone
---mint-- phoneno | bid
The bid in mint is a null column i added, the idea was to insert into that if it existed in the businesses table so i could later run a query to insert the none existant records.
I am basically trying to check if that phone number from the mint table is already in businesses before i insert it, otherwise i want to update it.