i want to update my table from another table using inner join,
Query :
UPDATE XYZ INNER JOIN ABC on ABC.Id = XYZ.Id
SET XYZ.Std = ABC.Std
sample data:
Table XYZ
ID STD
401471 QWERTY1 0 13.381 2013-01-01 00:00:00 2002-06-01 00:00:00 0 0 0 2002-06-01 00:00:00 2005-05-31 00:00:00
401472 QWERTY2 0 13.488 2013-01-04 00:00:00 2002-06-01 00:00:00 0 0 0 2002-06-01 00:00:00 2005-05-31 00:00:00
401473 QWERTY3 0 13.465 2013-01-07 00:00:00 2002-06-01 00:00:00 0 0 0 2002-06-01 00:00:00 2005-05-31 00:00:00
Table ABC
ID STD Q W
QWERTY1 2002-06-01 00:00:00 2005-05-31 00:00:00 0 0 0
QWERTY2 2002-07-01 00:00:00 2005-06-30 00:00:00 0 0 0
QWERTY3 2002-08-01 00:00:00 2005-07-31 00:00:00 0 0 0
The ID is not primary key, and i have more than 1.5 millions records with repeated ID and it repeated because the dates are different.
so my query is not working, as the connections gets lost error 2013, i tried changing the timeout from 600 to 6000, but failed to work as i cannot change the timeout of the db server which is in the cloud.
can anyone tell me , if the query is correct, if yes why is the connection getting lost?
so can i do it in chunks if the query is correct?