Compare two tabel and add/update query
-
Hi Team, I need to compare two tables and do the add/update functionality.If the Table2 have any new records it should be added in the Table1 and if the Table1 have same records which is in Table2, its should be updated. Table1 ID Name Mark 1 Kishor 56 2 Amit 78 4 Vinay 58 Table2 ID Name Mark 2 Amit 67 6 Raj 89 1 Kishor 98 Output ID Name Mark 1 Kishor 98 2 Amit 67 4 Vinay 58 6 Raj 89
-
Hi Team, I need to compare two tables and do the add/update functionality.If the Table2 have any new records it should be added in the Table1 and if the Table1 have same records which is in Table2, its should be updated. Table1 ID Name Mark 1 Kishor 56 2 Amit 78 4 Vinay 58 Table2 ID Name Mark 2 Amit 67 6 Raj 89 1 Kishor 98 Output ID Name Mark 1 Kishor 98 2 Amit 67 4 Vinay 58 6 Raj 89
It would be useful to know which database you are using. Assuming SQL Server then here is some google foo[^]
Never underestimate the power of human stupidity RAH