The article directories
Preface one, the code is as follows
preface
how to quickly calculate the distance between two coordinates in SQL native statement?
One, the code is as follows
code as follows (example) :
$lng=input('longtitude'); //Enter the vertical coordinates
$lat=input('latitude'); //Horizontal coordinates of the input
$distance="ACOS(SIN(( $lat * 3.1415)/180 ) *SIN((latitude * 3.1415)/180 ) +COS(( $lat* 3.1415)/180 ) * COS((latitude * 3.1415)/180 ) *COS(( $lng* 3.1415)/180 - (longtitude * 3.1415)/180 ) ) * 6380";
$fds=Db::table('activity')
->field($distance.' as distance')
->select();
Read More:
- [Modified] Hive SQL Error: SQL ERROR [10004] [42000]: Error while compiling statement: FAILED: SemanticException [Error
- [SQL ERROR] SQL Error: could not execute statement & query did not return a unique result: 2; nested excepti
- [Linux Docker Mirror] MYSQL Run sql Script Error: Failed to open file ‘/home/mydatabase.sql‘, error: 2
- java.sql.SQLException: Disk full (/tmp/#sql_1eaa2_60.MAI); waiting for someone to free some space
- Bulk Update Error: #Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the m
- [Solved] java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corres
- [Solved] SQL Error: Method queryTotal execution error of sql
- Introduction to Relational Databases in SQL
- mysql ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- Cause: java.sql.SQLException: ORA-01407: Unable to update (“MESIRJ”.”TMMIC01″.”RDEL”) is NULL
- linux mysql ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- Can mybatis prevent SQL injection
- Navicat connecting to SQL Server Error [How to Solve]
- [Solved] The number of rows returned by the mybatis UPDATE statement is always 1 or useaffectedrows = true
- How to Solve SQL state [HY000]: general error 2503
- SQL Developer error: Unable to find a Java Virtual Machine solution
- [Solved] Sphinx macos sql_connect: failed to load libmysqlclient
- IDEA Database Tool connects to SQL Server 2008 Error [How to Solve]
- SQL editor and reconnect [an exception when MySQL (workbench) updates data] [error code: 1175]
- MySQL Change password failure prompt: ERROR 1064(42000):You have an error in your SQL syntax: check the corresponds to your M