【发布时间】:2016-09-08 11:52:36
【问题描述】:
我有两个具有相同表名的类似查询,它们单独工作正常。但我想将它们与条件 ((city_id = 1 and country_id = 1) 或距离
合并第一次查询
select id , lat , long , city_id , country_id
from element_table
where city_id = 1 and country_id = 1 and id < 20
第二次查询 在这里,我使用经纬度搜索
select id , lat , long , city_id , country_id ,
my_distance_calculationformula_with_lat_long as distance
from element_table where id < 20 having distance = "20"
【问题讨论】:
-
你的问题是?
-
你也可以使用UNION