with median as
(select lat_n, row_number () over (order by lat_n asc) as row_asc,row_number () over (order by lat_n desc) as row_desc
from station
)
select round(avg(lat_n),4)
from median
where abs(row_asc-row_desc) <= 1
ERROR 1690 (22003) at line 1: BIGINT UNSIGNED value is out of range in '(median.row_asc - median.row_desc)'
while doin the same in postgresql the error shows-
ERROR: function round(double precision, integer) does not exist
LINE 7: select round(avg(lat_n),4)
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SQL state: 42883
Character: 152
Loading
Uday DodiyaPosted Sep 19, 2022, 5:55 AM
Try This
Rajanikant HawaldarPosted Sep 14, 2022, 8:19 AM
Try casting the double precision to int like below