Ruby on Rails
Friday, October 28, 2011
Hello,
What's the best/easiest way to write this delete statement using ActiveRecord 3.1?
DELETE e1FROM events e1JOIN events e2WHERE e1.subject_type = e2.subject_typeAND e1.subject_id = e2.subject_idAND e1.origin_type = e2.origin_typeAND e1.origin_id = e2.origin_idAND e1.id > e2.id
Thanks for the help.
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/oRQomT29TboJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment