日期:2014-05-18 浏览次数:20652 次
select cast(SQRT(col_x*col_x+col_y*col_y) as decimal(12,2)),* from tb
------解决方案--------------------
-- 定义坐标变量
declare @x1 int, @y1 int, @x2 int, @y2 int
-- 赋坐标值给变量
-- 套用距离计算公式
select sqrt(power((@x1-@x2),2)+power((@y1-@y2),2))