I am trying to do this with SQL in Ruby:
SELECT number*2 FROM dictionary;
I can use .select(:number) to get numeric columns "as is", but I don't know how to get them back. I tried this (which obviously didn't work):
.select(:number)
current_table.select(:number*2)
Try any of these
@newnumber = number.find(:all, :conditions => ["id = ?", @dictionary.id], :select => "number * 2 as newnumber") @newnumber = number.all(:conditions=>"id='#{@dictionary.id}'",:select=>"number * 2 as newnumber")