MegaTux MegaTux - 1 year ago 61
Ruby Question

Ruby Sequel gem: update a row column with a value from another row column that I know the Id

How to write this using the Sequel gem? :

update table set col = (select col from table where id = :x) where id = :y

I have the record with
but I want to avoid retrieving the record with
and then doing the update. Just one step!
Do I have to use raw sql (

Answer Source