Question

following, pre condition.

Table is called point, columns are id start_long start_lat des_lat des_long

Select 
  * 
from 
  point 
WHERE 
  SQRT((71,5x(`start_long`-`des_long`))x(71,5x(`start_long`-`des_long`))+(111,3x(`start_lat`-`des_lat`))x(111,3x(`start_lat`-`des_lat`)))<=10.0

I am receiving a #1241 - Operand should contain 1 column(s) error. What is wrong?

I want to easily get the results where the square root (this is the correct function for distance between two points) is less than 10 km.

x stands for the multiplication stars

Thanks

Was it helpful?

Solution

You are using commas for some numbers 71,5 and points in others 10.0

I suspect you're intending to use periods . for your decimals, and the commas are being interpreted as separate arguments.

OTHER TIPS

You have commas inside your SQRT function, causing your operand to have multiple columns.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top