*,
ROUND(
6371.393 * 2 * ASIN(
SQRT(
POW(
SIN(
(
39.9109245473 * 3.1415926 / 180 - lat * PI() / 180
) / 2
),
2
) + COS(39.9109245473 * 3.1415926 / 180) * COS(lat * PI() / 180) * POW(
SIN(
(
116.41338369712 * 3.1415926 / 180 - lon * PI() / 180
) / 2
),
2
)
)
) * 1000
) AS num
FROM
bbs_self_tide_gangname
ORDER BY
num ASC
用union拼接一下就行了,形如selet * from tablename where hdtime>='2013-5-6' order by hdtime
union all
selet * from tablename where hdtime<'2013-5-6' order by hdtime desc
当然这不是标准的语法,mysql中的时间比较偶不太清楚,你要自己修改一下。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)