dimanche 3 juillet 2016

Looking for a Creative Way to select random considering lat long distance

I am selecting five percent of all villages in an area by this query:

select top 5 percent * from Latlong_Amar  a
where a.IsInSarshomari=1 and a.ostan_num=02
order by newid()

Everything is fine, but I want to select random and I want to place a condition. I want to select some villages to check cellphone signal in an area, and the said query return a result, but it's not a desirable result for me. Usually places near main town are denser comparing remote villages, and when I use random, naturally, remote villages have less chance to be in the list. I have latitude and longitude of all villages. Do you somehow happen to think a way to select randomly and fairly considering destination of selected villages?




Aucun commentaire:

Enregistrer un commentaire