Skip to content Skip to sidebar Skip to footer

Can't Join And Select In Sequel -- Pg::syntaxerror

I'm trying to rename a column at join: # ............... result = DB[:my_items1].join(:my_items2, id: :my_item2_id). select([Sequel[:my_items2][:name].as(:my_ite

Solution 1:

Dataset#select takes multiple arguments, not a single array:

result = DB[:my_items1].join(:my_items2, id: :my_item2_id).
      select(Sequel[:my_items2][:name].as(:my_items_name), 
              Sequel[:my_items2][:amount].as(:my_item2_amount)
      )

Post a Comment for "Can't Join And Select In Sequel -- Pg::syntaxerror"