I have a table that I need to copy my data from (Log) to another table (BigTable). The log table received the following data:
LogID LogTime JobNumber LogType Description ===== ======= ========= ======= =========== 1 2012-09-01 00:00:01 1 100 Accepted by D
The following data is already in BigTable
JobNumber Accepted_At POB_At Completed ========= =========== ====== ========= 1 NULL NULL NULL 2 NULL NULL NULL 3 NULL NULL NULL
I am trying to update BigTable with values ββfrom the log. Please note that in the case of duplicate entries, such as LogID 1 and 2 (above), I only dial the last date (2012-09-01 00:05:33). The same is necessary for POB, since we are only interested in "POB in Stop 1".
There are millions of lines in the Journal for a large number of job numbers, however I need to get time only for those Jobs that are only in BigTable. The Ideal table (after all updates) will look like this:
JobNumber Accepted_At POB_At Completed ========= =========== ====== ========= 1 2012-09-01 00:05:33 2012-09-01 05:01:55 2012-09-01 05:15:36 2 2012-09-01 05:00:53 2012-09-01 05:04:00 2012-09-01 05:20:45 3 2012-09-01 05:02:22 2012-09-01 05:05:25 NULL
Please note that I am new to this field. Any help is appreciated. Thank you in advance. Relations
source share