I have a query that looks like this:
SELECT SUM(count) as rq
FROM usage_ip ...
The data it returns looks like this:
Why are integers strings? I can't do
_.sum() on them, for example.
When I run the same query in the database (outside of Retool), these are integer values.
Hey @erusev, welcome to the community
Seems like you have mixed data types for that column. If the input values are of a mixed data type, the result will be of the higher data type.
But you can cast to INT for
_.sum() to work
CAST(SUM(count) AS INTEGER) AS rq
Nice! It works when I cast to INT
I don't get it though -- that column is an integer (
int2), and all values in it are integers -- where are the mixed data types coming from