我计算逐渐执行此查询的坐标之间的距离。
/*insert into tmp11(select * from clients_lite where inwork > 0 limit(5000));*/
2
select *, cast(ATAN(SQRT(power((COS(tmp11.lat*PI()/180)*SIN(city.lon1*PI()/180-tmp11.lon*PI()/180)),2)+power((COS(city.lat1*PI()/180) *SIN(tmp11.lat*PI()/180)-SIN(city.lat1*PI()/180)*COS(tmp11.lat*PI()/180)*COS(city.lon1*PI()/180-tmp11.lon*PI()/180)),2))/ (SIN(city.lat1*PI()/180)*SIN(tmp11.lat*PI()/180)+COS(city.lat1*PI()/180)*COS(tmp11.lat*PI()/180)*COS(city.lon1*PI()/180-tmp11.lon*PI()/180)))*6372795 as int) as distance into dist from tmp11 inner join city on cast(ATAN(SQRT(power((COS(tmp11.lat*PI()/180)*SIN(city.lon1*PI()/180-tmp11.lon*PI()/180)),2)+power((COS(city.lat1*PI()/180) *SIN(tmp11.lat*PI()/180)-SIN(city.lat1*PI()/180)*COS(tmp11.lat*PI()/180)*COS(city.lon1*PI()/180-tmp11.lon*PI()/180)),2))/ (SIN(city.lat1*PI()/180)*SIN(tmp11.lat*PI()/180)+COS(city.lat1*PI()/180)*COS(tmp11.lat*PI()/180)*COS(city.lon1*PI()/180-tmp11.lon*PI()/180)))*6372795 as int) between 0 and 60000
3。
4./*insert into clients_res(select clients.pid, clients.owner_id, dist.country, dist.city, dist.distance, clients.inwork from clients left outer join dist on clients.pid = dist.pid); */
{{1}}
如何将其转换为程序?