Tuesday, 6 August 2013

Correct sql (arel) for this query?

Correct sql (arel) for this query?

I have two tables, one with users, the other with profiles. Each table has
a created_at column, where I want to update profiles.created_at so that it
is the same as the corresponding row (determined by user_id) in
users.created_at.
In Rails, I might do something like:
Profile.update_all(created_at: {???})
Trying to create an efficient query as this is being performed on over a
million rows.

No comments:

Post a Comment