Posts

Showing posts from February 9, 2019

MySQL distinct query, result into another table

Image
-3 I have two field lat and lng in tbl1. I just like to select only the unique numbers from both field and I like to place the result in tbl2 in the fields with the same name lat and lng. Sorry about my inaccuracy. Tbl1 is a square grid of coordinates, that is, the latitude coordinate is the same on each row of the grid, and the longitude coordinate is the same on each column, respectively. So there are as many different longitude and latitude coordinates in the result. Example - if grid is 100 x 100, tbl1 has 10000 rows and result table tbl2 has 100 rows or even smaller grid 2 x 2: tbl1: lat,lng,some more fields,.. 65.123456,24.123456,.. 65.123456,24.123567,.. 65.123567,24.123456,.. 65.123567,24.123567,.. tbl2: lat,lng 65.123456,24.123456 65.123567,24.123567 I have tried the following: