문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top