2
 SELECT ACOS(31.552278760192) 

when executed in MSSQL Server it returns some value but when executed in MYSQL it returns null.

Any kind of help is appreciated.

4
  • 1
    Why do not you check what ACOS(SIN(31.552278760192) * SIN(latitute) + COS(31.552278760192) * COS(latitute) * COS(longitute) - 74.338372290294) * 6371 is returning on mySQL? There might be some issue there. Commented Nov 4, 2011 at 5:25
  • Agreed - you need to break down each selection. Commented Nov 4, 2011 at 5:27
  • @Kangkan, I am not so lazy. I have checked it. It is returning something which is not null. Commented Nov 4, 2011 at 5:27
  • @Kangkan, I have edited the original post kindly read it again. Commented Nov 4, 2011 at 5:36

1 Answer 1

2

From the fine manual:

ACOS(X)
Returns the arc cosine of X, that is, the value whose cosine is X. Returns NULL if X is not in the range -1 to 1.

So 31.552278760192 is out of range for MySQL's ACOS. In fact, the arccosine function doesn't produce a real number as a result outside of [-1,1] and acos(31.552278760192) is ~4i.

Sign up to request clarification or add additional context in comments.

1 Comment

Great grand reply. Such a deep insight. Where is the +10 up vote button?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.