Home > database >  Ask a question of navicat tool
Ask a question of navicat tool

Time:10-02

With navicat built set after the uniqueness of the primary key table, there was a problem in importing data,
Measured, entry mode selection is added, when the source data is the primary key column have duplicate values duplicates complains are not recorded, but at the same time some no repetitive data may also be missing, such as article 500 data, of which 200 are duplicates, under normal circumstances should be recorded 300 data, measured in the process of normal school of less than 300,
Actually this entry mode selection can add or update seems to solve, but a great deal of drag down the speed of the input, especially when data accumulated more, the causes of the problem and solution, please?

CodePudding user response:

This kind of situation, when import should not be directly imported into the target table,
Add a transition table TMP, import the data to the TMP table, then TMP the data in the table according to the condition can be inserted into the target table:
Similar:
 INSERT INTO targetTable (c1, c2) 
SELECT c1 and c2 FROM TMP AS a
WHERE NOT the EXISTS (
SELECT * FROM targetTable AS b WHERE a.c 1=1 AND biggest a.c=biggest 2
);

CodePudding user response:

Quote: refer to 1st floor yenange response:

This kind of situation, when import should not be directly imported into the target table,
Add a transition table TMP, import the data to the TMP table, then TMP the data in the table according to the condition can be inserted into the target table:
Similar:
[code=SQL] INSERT INTO targetTable (c1, c2)
SELECT c1 and c2 FROM TMP AS a
WHERE NOT the EXISTS (
SELECT * FROM targetTable AS b WHERE a.c 1=1 AND biggest a.c=biggest 2
);

There is a question that all operations of the same circumstances, the insert in the steps of the last step of the advanced options, uncheck "use expand insert statement," I don't input the requirement of the duplicate data can achieve, but the speed will be greatly dragged down, but I look at the development principle of statement does not seem to affect ah, why will have this two different results?

CodePudding user response:

You do as I am # 1, slowed again,
Navicat are only tools of a third party, do not need to knot knot in it,
  • Related