Question : MySQL to t-SQL

I want to write the following query (written for mysql) for sql server:

SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20;

having some trouble...can someone help please?  thanks

Answer : MySQL to t-SQL

check this
1:
2:
3:
4:
5:
6:
select top 20 * from (
select id, 
       ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance 
FROM markers 
) a
where distance < 25 ORDER BY distance
Random Solutions  
 
programming4us programming4us