declare @a decimal(18,7) --经度  
declare @b decimal(18,7) --维度  
set @a=120.076
set @b=30.3273
declare @c decimal(18,7)  
set @c=6378137  --地球半径  
select id,name,address,registaddress,longitude,latitude,sqrt(    
    (    
     ((@a-longitude)*PI()*@c*cos(((@b+latitude)/2)*PI()/180)/180)    
     *    
     ((@a-longitude)*PI()*@c*cos (((@b+latitude)/2)*PI()/180)/180)    
    )    
    +    
    (    
     ((@b-latitude)*PI()*@c/180)    
     *    
     ((@b-latitude)*PI()*@c/180)    
    )    
) as JL from t_corporation where sqrt(    
    (    
     ((@a-longitude)*PI()*@c*cos(((@b+latitude)/2)*PI()/180)/180)    
     *    
     ((@a-longitude)*PI()*@c*cos (((@b+latitude)/2)*PI()/180)/180)    
    )    
    +    
    (    
     ((@b-latitude)*PI()*@c/180)    
     *    
     ((@b-latitude)*PI()*@c/180)    
    )    
)<10000