I need to calculate Distance between two location through Pl SQL Query. I had tried some Qry but not getting it.
for this we are using Query in SQL is as follows
SELECT ROUND(geography::Point(cast('19.2806118' as float),cast('72.8757395' as float) ,
4326).STDistance(geography::Point(cast('19.4482006' as float),
cast('72.7912511' as float), 4326))/1000,1) DIST
Result : 20.6
To Calculate the same in ORACLE Db I have found a solution over internet which is as follows
select sdo_geom.sdo_distance(sdo_geometry(2001,4326,null,sdo_elem_info_array(1, 1, 1),
sdo_ordinate_array( 19.2806118,72.8757395)),sdo_geometry(2001,4326, null,sdo_elem_info_array(1, 1,
1),sdo_ordinate_array( 19.4482006,72.7912511)),1,'unit=KM') distance_km from dual
Result : 10.9271..
Please suggest the method which will give me result in KM as I am getting MS SQL