title: distance between two longitude and latitude
body: <p>How should I write query for this?
  Consider P1(a, b)  and P2(c, d) to be two points on a 2D plane.</p>
  
  <ul>
  <li>a happens to equal the minimum value in Northern Latitude (LAT_N in
  STATION).  </li>
  <li>b happens to equal the maximum value in Northern Latitude
  (LAT_N in STATION)</li>
  <li>c happens to equal the minimum value in Western
  Longitude (LONG_W in STATION)</li>
  <li>d happens to equal the maximum value
  in Western Longitude (LONG_W in STATION)</li>
  </ul>
  
  <p>Query the Manhattan Distance between points P1 and P2 and round it to a scale of 4 decimal places.</p>
  
  <p><strong>Table STATION(ID number, CITY varchar2(21), STATE varchar2(2), LAT_N number, LONG_W number)</strong></p>
  
  <p>this is my try but returns NULL</p>
  
  <pre><code>select
      2 * 3961 * asin(power(sqrt((sin(radians(MAX(LAT_N) - MIN(LAT_N)) / 2) )) , 2 ) + cos(radians(MAX(LAT_N))) * cos(radians(MIN(LAT_N))) * power(sqrt((sin(radians(MAX(LONG_W) - MIN(LONG_W)) / 2) )) , 2 )) as distance from station where city like 'manhattan';
  </code></pre>
  
  <p>any idea will be appreciated</p>