In my table tblStore there are store some location latitude and longitude according to store address I want to get an exact store, as well as nearby function, means user enter any state, city, address or Pincode so they can check with data eg. Latitude Longitude column as gives nearby match data. So for that, I write a query as below. MY TABLE
StoreName StoreAddress City State Pincode Latitude Longitude
ABC LAVBHANDI RAIPUR CHHATTISGARH 492001 21.23976180 81.68179490
SDF AIRPORT AHMEDABAD GUJARAT 380003 21.06800900 70.49738180
QWE GORWA VADODARA GUJARAT 390023 22.32212250 73.16322990
ZXC MUGDALLA SURAT GUJARAT 395007 21.14517370 72.75489680
HUI MAHADEVPUR BANGALORE KARNATAKA 560048 12.99703720 77.69443030
TSM YASHWANTPUR BANGALORE KARNATAKA 560055 13.01079010 77.55269750
RRS MAHADEVPUR BANGALORE KARNATAKA 560048 12.99633780 77.69316240
JJK KEMPSCORNER MUMBAI MAHARASHTRA 400036 18.96409600 72.80603600
LLI PAREL MUMBAI MAHARASHTRA 400013 18.99463540 72.82238490
GT SANTACRUZ MUMBAI MAHARASHTRA 400099 19.09108550 72.85647240
SSS MALAD MUMBAI MAHARASHTRA 400062 19.18504160 72.83411740
GKO GHATKOPAR MUMBAI MAHARASHTRA 400086 19.09987280 72.91395000
So my query is supposed I search store address like Andheri but my table no Address like Andheri so it checks in DB and returns to Andheri nearest location. I take Andheri location by using jquery I fetch latitude and longitude of Andheri location and pass to DB
MY SQL QUERY WAS :
declare @Latitude decimal(18,8)= 19.113645
declare @Longitude decimal(18,8)= 72.86973390000003
declare @latmin decimal(18,8) = @Latitude -0.30;
declare @latmax decimal(18,8) = @Latitude +0.30;
declare @longmin decimal(18,8) = @Longitude -0.30;
declare @longmax decimal(18,8) = @Longitude +0.30;
select * from tblStore
where Latitude between @latmin and @latmax
and Longitude between @longmin and @longmax
order by Latitude desc
it shows me all store location in Mumbai I want onlySantacruz and malad So how to set diameter for google location using SQL query.