This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:sql:functions:distance [2011/03/02 18:39] 127.0.0.1 external edit |
dev:sql:functions:distance [2013/02/06 20:08] doc |
||
---|---|---|---|
Line 4: | Line 4: | ||
===== Description ===== | ===== Description ===== | ||
- | The $DISTANCE function calculates the distance between one set of geographic coordinates and one or more other geographic coordinates. This is used for performing geographic radius searches, such as finding all rows within five miles of a given location. This can also be used to simply calculate the distance between two points. The following [[admin:optimization:geo:home|article]] provides more detail on performing geographic searches in Omnidex. | + | The $DISTANCE function calculates the distance between one set of geographic coordinates and one or more other geographic coordinates. This is used for performing geographic radius searches, such as finding all rows within five miles of a given location. This can also be used to simply calculate the distance between two points. The following [[admin:features:geo:home|article]] provides more detail on performing geographic searches in Omnidex. |
This function returns a DOUBLE datatype. | This function returns a DOUBLE datatype. | ||
Line 54: | Line 54: | ||
== destination_select_statement == | == destination_select_statement == | ||
- | Optional. A select statement that returns one or more rows containing first the latitude and then the longitude in two consecutive select-items. These pairs of coordinates represent the destination(s) of the search. Since //destination_select_statement// can return multiple rows, this allows geographic radius searches requesting rows within a certain distance from a number of locations, such as stores or branch offices. | + | Optional. A select statement that returns one or more rows containing first the latitude and then the longitude in two consecutive select-items. These pairs of coordinates represent the destination(s) of the search. Since //destination_select_statement// can return multiple rows, this allows geographic radius searches requesting rows within a certain distance from a number of locations, such as stores or branch offices. Note that for performance reasons, this select statement may not return more than 1,000 rows. |
===== Example ===== | ===== Example ===== |