I have a table ‘posts’ , each record has 2 fields ‘post_count’ and
‘post_value’
I would like to find all records, sorted on the calculated ratio value:
‘post_value’ / ‘post_count’
I am using MySQL 5 so I could use a stored procedure, but how can I sort
on the calculated value ,
can I write something like :
Post.find( :all, :select => [‘post_count’, ‘post_value’,
?calculated_value?], :order => ?calculated_value?)
thanks for your suggestions
kad