Weather Observation Station 20

Sort by

recency

|

3999 Discussions

|

  • + 0 comments
    WITH cte AS (
        SELECT LAT_N,
            COUNT(*) OVER () AS n,
            ROW_NUMBER() OVER (ORDER BY LAT_N) AS rn
        FROM STATION
    )
    SELECT ROUND(AVG(LAT_N), 4) FROM cte
    WHERE rn=(n+1)/2 OR rn=(n+2)/2
    
  • + 0 comments

    Using oracle inbuild function MEDIAN

    SELECT 
        ROUND(MEDIAN(LAT_N),4)
    FROM 
        station
    ;
    
  • + 0 comments
    WITH indexed AS( 
        SELECT LAT_N , ROW_NUMBER() OVER(ORDER BY LAT_N ASC) AS idx 
        FROM STATION 
    ) 
    select round(lat_n,4) 
    from indexed 
    where idx =(select (count(*)+1)/2 from station);
    
  • + 0 comments

    WITH indexed AS( SELECT LAT_N , ROW_NUMBER() OVER(ORDER BY LAT_N ASC) AS idx FROM STATION )

    SELECT ROUND(LAT_N, 4) FROM indexed WHERE idx = ( SELECT COUNT(LAT_N) FROM STATION ) / 2

  • + 0 comments

    with c1 as (select , dense_rank() over (order by lat_n) as rnk from station) select round(lat_n,4) from c1 where rnk=(select (count()+1)/2 from station);