Hi All,
I need help to write a query to get the values from two tables. Both tables have the same fields. Most of the records are mattched. My query should append the unmatched records from table2 to table1.
So let me understant it:
Table1 has 5 records, Table2 has 15 records.
5 records from table1 are in table2. You want to take 10 records from table2 that are NOT in table1 and add them to table1?
If so,
1. why do you want to have 2 tables with the same data?
2. how about very simple:
DELETE FROM Table1
INSERT INTO Table1 (SELECT * FROM Table2)
I have two tables (Baseline run, Regression run) from two run of similar pay. Fields on these tables are EmpID, Name, ElementClassification, ElementReportingName, ElementName, Amount). Data on these two tables might be similar, or different. I need to write a query to reconsile this two tables and identify the difference if any.
Hirasif
You would be better off if you would provide a simple example of a few records in those 2 tables to represent your issue.
Something like:
Baseline table
[pre]
EmpID Name EleClass
12 Joe ABC
13 Sus XYZ
14 Rob ABC
[/pre]
Regression table
[pre]
EmpID Name EleClass
12 Joe ABC
25 Bob DEF
[/pre]
and specify what should happen, which records from what table should be copied to what table, and what are the criteria of why these records and not the other records.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.