Cast syntax to convert a sum to float March 28, 2023 by Tarik I use the shorthand cast syntax almost everywhere: SELECT sum(seconds)::float / -1323 AS averag; More details: Postgres data type cast