D
D
drka2016-01-28 19:07:30
PHP
drka, 2016-01-28 19:07:30

How to transfer data from one table to another?

guys there are 5 tables. One temporary data is initially entered into it, the other main information needs to be transferred to them, depending on what I am loading. Here's the actual question: it is necessary to transfer all data from temp_table to main_table, taking into account duplicates. if there is a duplicate - update all the data in the line.
the table structure is the same:
id int(11) not null autoincrement,
xml_id varchar(128) not null,
name text not null,
quantity int(11) not null,
price double(5,2) not null
ps phone is inconvenient.
pps a lot of data (50-500k lines)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
betal, 2016-01-28
@betal

REPLACE INTO ... FROM SELECT ...
INSERT INTO ... FROM SELECT ... ON DUBLICATE ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question