I'm trying to update a new column added to a table by selecting summed
amounts from another table.

  DB[:aging_history___ah].filter(:month_group => month_group).
  update(:adjustments => DB[:billing_details___bd].filter(:bd__billing
=> :ah__billing).
    filter(:entry_date =>
(start_date..end_date)).filter(:transaction_class =>
'ADJ').sum(:amount))

month_group, start_date, end_dates are variables passed into the
function, so irrelevant.

Looking to generate:

   update aging_history ah
   set adjustments = (select sum(amount)
          from billing_details bd
          where transaction_class = 'ADJ' and bd.billing = ah.billing)

Thought to try update{} for virtual row block-style approach, but that
didn't work, either.

Michael
-- 
http://codeconnoisseur.org

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to