ahh perfect! that's great. Thanks Jeremy, much appreciated all the support and dev work you do on Sequel gem
On Wednesday, September 26, 2018 at 10:00:07 AM UTC-7, Jeremy Evans wrote: > > On Wednesday, September 26, 2018 at 8:37:50 AM UTC-7, Harlow wrote: >> >> 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]`? >> > > Sequel.function(:array_agg, ids).sql_subscript(1).as(:id) > > Thanks, > Jeremy > -- 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.
