Update a Table using the Data from Another Table

2011-09-19


There are lots of ways to update a table data, here we have one example as the following:

UPDATE HOSTDB     
SET       
InScan = NOWHOSTDB.InScan,      
Alarm1 = NOWHOSTDB.Alarm1,      
Alarm2 = NOWHOSTDB.Alarm2,      
Alarm3 = NOWHOSTDB.Alarm3,      
Alarm4 = NOWHOSTDB.Alarm4       
FROM HOSTDB, NOWHOSTDB      
WHERE HOSTDB.idx = NOWHOSTDB.HOSTDBidx      
AND HOSTDB.idx = 1640