We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Weather Observation Station 19
Weather Observation Station 19
Sort by
recency
|
2214 Discussions
|
Please Login in order to post a comment
select round( sqrt( power( max(lat_n)-min(lat_n) ,2)+ power( max(long_w)-min(long_w) ,2)),4) from station;
I am using this query but getting error can anyone help
WITH sorted_lat AS ( SELECT lat_n FROM station ORDER BY lat_n ASC ), counting AS ( SELECT COUNT(*) AS total_count FROM station ) SELECT ROUND( CASE WHEN total_count % 2 != 0 THEN (SELECT lat_n FROM sorted_lat LIMIT 1 OFFSET total_count / 2) ELSE ( (SELECT lat_n FROM sorted_lat LIMIT 1 OFFSET (total_count / 2) - 1) + (SELECT lat_n FROM sorted_lat LIMIT 1 OFFSET total_count / 2) ) / 2 END, 4 ) FROM counting;
ms sql server: select format(round(sqrt(power(min(lat_n)-max(lat_n), 2) + power(min(long_w)-max(long_w), 2)), 4), '0.####') from station
select round( SQRT( POWER(MAX(LAT_N)-MIN(LAT_N),2) + POWER(MAX(LONG_W)-MIN(LONG_W),2) ) ,4) from STATION;