![]() | SQXHypot Method |
Namespace: sqx
public static SqlDouble Hypot( SqlDouble X, SqlDouble Y )
-- Using Hypot to order by Nearest Neighbor declare @V1 float = 5.5, @V2 int = 50, @V3 bigint = 250 declare @T table (ID int NOT NULL identity primary key, V1 float, V2 int, V3 bigint) insert @T (V1,V2,V3) select sqx.Exponential_PPF(a.Value, 0.25) , sqx.Poisson_PPF(b.Value,55) , sqx.Poisson_PPF(b.Value,255) from sqx.UTable(100,1) a inner join sqx.UTable(100,2) b on a.ID = b.ID inner join sqx.UTable(100,3) c on a.ID = c.ID select * from @T order by sqx.Hypot(@V1 - V1, sqx.Hypot(@V2 - V2, @V3 - V3))