написал запрос
select
'request_median_duration' as metric_name,
EXTRACT(EPOCH FROM request_median_duration)/60 as metric_value,
TO_CHAR(NOW(), 'YYYY-MM-DD HH:MM:SS') as push_dttm
from mp_statistics
нужно округлить до 2 знака до запятой
попробовал сделать так
select
'request_median_duration' as metric_name,
ROUND(EXTRACT(EPOCH FROM request_median_duration)/60,2) as metric_value,
TO_CHAR(NOW(), 'YYYY-MM-DD HH:MM:SS') as push_dttm
from mp_statistics
возвращается ошибка
SQL Error [42883]: ERROR: function round(double precision, integer) does not exist
Подсказка: No function matches the given name and argument types. You might need to add explicit type casts.
Позиция: 94
выкрутился так
select
'request_median_duration' as metric_name,
ROUND(EXTRACT(EPOCH FROM request_median_duration)/60*100)/100 as metric_value,
TO_CHAR(NOW(), 'YYYY-MM-DD HH:MM:SS') as push_dttm
from mp_statistics
какой есть еще более изящный вариант?