i'm trying to select the first element from an array_agg function:
https://www.postgresql.org/docs/9.5/static/functions-aggregate.html

The issue is i'm having trouble figuring out where to put the `[1]` when 
using Sequel

For example i'd like the first value of the array:

array_agg(ids)[1] as id


However in in Sequel I'm not sure how to get the first element:

Sequel.function(:array_agg, ids).as(:id) # => this is array


Is there a Sequel syntax for `[1]`?

Thanks in advance,
Harlow

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to