I have two similler queries with same table name which are working fine individually. But I want to merge them with condition ((city_id = 1 and country_id = 1) or distance < "20")
First query
select id , lat , long , city_id , country_id
from element_table
where city_id = 1 and country_id = 1 and id < 20
Second query Here I am using search with lat lon
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"