Answer the question
In order to leave comments, you need to log in
How to insert unique values into a table?
There is a table with coordinates
lat float
lng float
How to write an INSERT so that the data does not repeat.
Now I am able to insert non-repeating data like this
. I take all the records in PHP and take the data that needs to be inserted (they can be from 0 to 50 maximum at a time) and compare them. This option does not suit me because there can be more than a million records. Is there a way to write a more optimal INSERT ?
And if the lat lng fields are designated as UNIQUE mysql will drive itself?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question