Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • No need for the ActiveRecord flag. The MAX(*) row should always be the current record. Restoring to a previous version simply inserts said row into the table again. Commented Jul 10, 2012 at 14:19
  • I wasn't sure how to make the select work, but now that you're calling this out I'm thinking about it and have an idea, hmmmm Commented Jul 10, 2012 at 14:34
  • Usually MAX(column_name) selects the largest value in the table's column. To select the whole row, a simple select top 1 order by id descending will do. Commented Jul 11, 2012 at 7:46
  • Yeah, that works for a simple single record but my table was a collection of child records which would need to be selected at once but could have been modified individually. Just a little more complex. Commented Jul 11, 2012 at 12:05