Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need advice here

Status
Not open for further replies.

EdLentz

Technical User
Mar 20, 2002
85
US
I have two tables They are for inventory. I have fields in each that would be duplicate entries for example: a row in each table that has the same part number, but maybe a different description and price. Then I might have parts in the one table that are not in the other and I would want to get those into the one table. I guess what I am trying to say is I want to merge the two tables into one. Will I need to use two queries, an insert to get the info from the one into the other without duplicates, and then an update for the duplicates? Or is there a single query way to do this, or should a novice just use two queries??

Thanks
Ed
 
If what you want to do is to copy records from table2 to table1, overwriting any existing matching records, then you could use (assuming the tables have identical structures):
[tt]
REPLACE table1 SELECT * FROM table2
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top