Home > database >  2 in the table, calculating the difference between two columns (circulation), output qualified data,
2 in the table, calculating the difference between two columns (circulation), output qualified data,

Time:09-24

to ask the great spirit, give a a recruit!!!!!! Thank you very much!!!!!!
1, I have two tables in mysql, each table inside has three fields (id, latitude and longitude)
2, I made a function for the distance of the two latitude and longitude and limit, a total of four parameters, dis_jl_ok (2, 1 1 longitude, latitude and longitude latitude 2, the limit distance range) distance if within the scope of the 'limit distance' output ' in
' problem: I query two tables the id of the latitude and longitude, distance within a certain range of output correlation id, slowly, there is no other way,

 SELECT 
` ` in table 1. Id,
` ` in table 1. ` longitude `,
` ` ` in table 1. ` latitude,
` ` (table 2). The id,
` ` table 2. ` ` longitude,
` ` table 2. ` latitude `
The FROM
` `, table 1 ` ` table 2
WHERE
- output 100 meters to 300 meters between the id of the
Dis_jl_ok (` ` in table 1. ` longitude `, ` ` in table 1. ` ` latitude, ` table 2 `. ` longitude `, ` ` table 2. ` ` latitude, 100300)='meet'

my each table probably around 100000 data, he want to compare 100000 * 100000 times, to ask, do you have any other plan to achieve this function, I feel I couldn't finish running for a few hours, the

simple point said is what I want, different table, the difference of two columns, output the qualified data,

,

CodePudding user response:

...
  • Related