怎样查询附近的好友? 本帖最后由 zzxap 于 2012-08-27 20:09:16 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tablenameorder by power((纬度-@纬度),2)+power((经度-@经度),2) declare @T table([经度] numeric(8,5),[纬度] numeric(7,5))insert @Tselect 122.23423,23.23234 union allselect 123.23678,23.23456 union allselect 124.43342,34.23232select * from @Torder by power((纬度-23.23111),2)+power((经度-122.23111),2)/*经度 纬度------------------------------ ------------------------------122.23423 23.23234123.23678 23.23456124.43342 34.23232(3 row(s) affected)*/ 要支持sql 2000才行,能支持sqlite更好目前数据库是sqlite select * from @T order by (纬度-23.23111)+(经度-122.23111) 求解判断是否为第三范式 SELECT如何实现上行数据和本行数据相加或相减 SQL 2005 用户架构删除问题,在线等等中!急 请教一个简单的两表更新的语句 循环相减 数据库设计问题请教 怎样在视力中实现查询结果向上取整 如果动态表,怎样插入数据,及读取数据 标准分的计算方法及实现,来者有分 SQL问题求解,Access2000中的UpdateSQL如何写?难! 如何将B表的一个字段的数据复制到A表中的一个字段,这个字段名一样的 SQL SERVER 2005 同步複製 疑問
select * from tablename
order by power((纬度-@纬度),2)+power((经度-@经度),2)
declare @T table([经度] numeric(8,5),[纬度] numeric(7,5))
insert @T
select 122.23423,23.23234 union all
select 123.23678,23.23456 union all
select 124.43342,34.23232select * from @T
order by power((纬度-23.23111),2)+power((经度-122.23111),2)
/*
经度 纬度
------------------------------ ------------------------------
122.23423 23.23234
123.23678 23.23456
124.43342 34.23232(3 row(s) affected)
*/
目前数据库是sqlite