Updating table with data from another table
Hi I have two tables, T1 contains 2005 data and T2 contains 2004 data I would like to take all the data from T2 and drop it into T1 so that i have both years in T1. I've successfully created a database with tables, forms and some simple reports. Now I'm turning to managing the maintenance and developing some more sophisticated reporting.
Assuming this is best done with a SQL command, I'm looking for some help writing the SQL for it. Since you already have these tables linked, you only need an SQL select to obtain the information anytime it is needed.Additionally, since it is a query, it allows the statement to be stored in the Query section.Same result using a join in a SELECT statement: SELECT "Accounts".*, B."Balance" FROM "Accounts" LEFT JOIN (SELECT "Acct No", "Balance" FROM "Balance History", (SELECT "Acct No", MAX("Balance Date") SELDATE FROM "Balance History" GROUP BY "Acct No") A WHERE "Balance History"."Acct No" = A."Acct No" AND "Balance History"."Balance Date" = A. I understand your advice against keeping balances this way, but you can rest assured that we have reasons for maintaining a history of the account balances.So I need to update the table in the new DB from the table in the old DB which has around 1000 rows.I have two databases database 1 and database 2, and both are similar tables and columns I have deleted 10 records from database1.employee table Now i need to copy the data from database2.employee to the first table How can i do it.
Search for updating table with data from another table:
Database1 (Test1) is the latest, and database2 (Test2) is an old copy of the database.