puts DB[:aging_variant___av].
  join(:billing_headers___bh, :bh__billing => :av__billing).
  update_sql(:av__date_created => :bh__created_date)

=>
UPDATE `aging_variant` AS `av` INNER JOIN `billing_headers` AS `bh` ON
(`bh`.`billing` = `av`.`billing`) SET `av__date_created` =
`bh`.`created_date`

run it =>
Sequel::DatabaseError: Mysql::Error: Unknown column 'av__date_created'
in 'field list'

remove the "av" alias:
DB[:aging_variant___av].
  join(:billing_headers___bh, :bh__billing => :av__billing).
  update(:date_created => :bh__created_date)

=>
Works!

Sequel 3.8.0, Ruby 1.8

Michael

-- 
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