创建一个功能函数然后再计算就可以了! alter function dbo.distance(@x float,@y float,@a float,@b float,@radius int) returns int begin declare @t int if sqrt((@x-@a)*(@x-@a)+(@y-@b)*(@y-@b))<=@radius set @t=1 else set @t=0 return @t endselect * from 圆 where dbo.distance(x,y,0,0.2,1)=1
在客户端用delphi等语言可能更快.
alter function dbo.distance(@x float,@y float,@a float,@b float,@radius int)
returns int
begin
declare @t int
if sqrt((@x-@a)*(@x-@a)+(@y-@b)*(@y-@b))<=@radius
set @t=1
else
set @t=0
return @t
endselect * from 圆 where dbo.distance(x,y,0,0.2,1)=1