MySql database, there will be duplicate records when querying data export (the more data the more obvious)

When the query data, large amount of data, we will use the paging function.

How much data per page display.

In this case, half do not see what the problem is.

And when you export data, sometimes by means of paging is gradually speaking append data to the export file.

When all data is exported, it is possible to duplicate the number of records will appear.

Are also considered the reason is simple, MySql if the sort field have the same value, if no other defined, can not guarantee that every time the same sequence.

A first possible, B after, it may turn.

If this happens when you turn the exchange, there will be two possible A, each less B.

The solution is to add a sort field will not be repeated. Such as ID (increment) field, will not be repeated.

This basically solved the problem gradually added to export the results of duplicate records.

Guess you like

Origin www.cnblogs.com/leafinwind/p/11308292.html