It is not currently possible to cast the function (mean) result. You can
cast the field prior to having the function called on it, though. For
example:

```
SELECT mean("value"::integer) AS value FROM "measurement" WHERE "Host" =
'XYZ'
```

Will work, but probably isn't what you want. Kapacitor has the ability to cast
results
<https://docs.influxdata.com/kapacitor/v1.1/tick/expr/#type-conversion-functions>,
however it may be overkill if you are not already using it in your stack.
I'd recommend opening a feature request
<https://github.com/influxdata/influxdb/issues/new> if you'd like to see
this functionality added.

On Tue, Dec 6, 2016 at 7:15 AM, <[email protected]> wrote:

> Hi !
>
> Following query does not work ...
>
> SELECT mean("value")::integer AS value FROM "measurement" WHERE "Host" =
> 'XYZ'
>
> The documentation only has following examples:
> SELECT "water_level"::integer FROM "h2o_feet"
>
>
> greets
> claus
>
> --
> Remember to include the version number!
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxData" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/b349dc4f-d74d-4060-952e-e524b44d6a9e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CAD8sRLABAH%2Bk514OCF62pnUdusS1E62eg%3DQhH3Hz5ycug5HdLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to