SELECT a.seqID,a.userID,a.supportNum,a.longitude,a.latitude,b.sex,b.imageURL,b.approved headapproved, round(6378.138*2*asin(sqrt(pow(sin( (a.latitude*pi()/180-39.984785*pi()/180)/2),2)+ cos(a.latitude*pi()/180)*cos(39.984785*pi()/180)* pow(sin( (a.longitude*pi()/180- 116.32244*pi()/180)/2),2)))*1000)/1000 distance, case when constellation in ("巨蟹座","天蝎座","双鱼座") then "1" when constellation in ("白羊座","狮子座","射手座") then "2" when constellation in ("金牛座","处女座","摩羯座") then "3" when constellation in ("双子座","天秤座","水瓶座") then "4" end as galaxy FROM t_user_profile a, user b WHERE 1=1 and a.userID=b.userID and a.userID!=350369 and a.birthday between '1915-10-12 00:00:00' and '1997-10-12 00:00:00' ORDER BY b.approved desc,distance asc,galaxy asc LIMIT 0,12