1

Topic: Optimization INSERT INTO at introduction of the data with repeating records

Hello, companions!
Beforehand , could not find the clear answer to the question.
Essence:
Let's assume, there are two cities, in them certain departments of one company are allocated. This information is necessary for importing to a DB.
It is possible to produce some operations on adding of a city with a binding to id department
...(' St. Petersburg ', 1),
(' St. Petersburg, 2 '),
etc
But that that prompts to me what probably to import the binding information a city-id as that more optimally, one iteration.
Respected , whether there is such possibility?

2

Re: Optimization INSERT INTO at introduction of the data with repeating records

giselero;

INSERT INTO your_table (name, id)
SELECT ' St. Petersburg ', 1 from dual union
SELECT ' St. Petersburg ', 2 from dual

Well, and architecturally it is better to carry out the reference manual of cities in the separate table